Click here to Skip to main content
15,894,410 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Microsoft JScript runtime error: Object doesn't support this property or method when i am using $("#div").html(response)
alert(response); works
$("#div").html("Hello World"); also works
Posted
Comments
harish85 28-Jun-11 19:02pm    
What does response have ?
Member 8043227 28-Jun-11 19:22pm    
response has an html for some user control.
i need to load a usercontrol in div.
Member 8043227 28-Jun-11 19:24pm    
Scenario is:
I have a 'type dropdownlist', based on selection made on type, i have to fill sub type dropdownlist.
onload of 'type ddl' i am calling a function to load subtype ddl.
Member 8043227 28-Jun-11 19:27pm    
View side code

<div>

<%=Resources.ProductLabels.Type%>


<%=Html.DropDownList("TypeDropDownList_1", Model.CustomPaxList, new { @class = "fldtls", onchange = "LoadPassengerSubTypes('1')" })%>
</div>
Member 8043227 28-Jun-11 19:28pm    
Javascript

function LoadPassengerSubTypes(controlPrefix) {
var proxy = new ServiceProxy({ show: true });
var selectedtype = 0;
//alert(("SubTypePaxControl_" + controlPrefix));
selectedtype = $("#TypeDropDownList_" + controlPrefix).val();
var serializeform = "selectedType=" + selectedtype + "&count=" + controlPrefix;
proxy.invoke(
'/Product/LoadSubTypePAXTypeControl/',
'GET',
serializeform,
function (response) {
$("#"+ controlPrefix ).html(response);
$("#"+ controlPrefix ).show();
});
return false;
}

1 solution

It appears you are using JQUery. Have you included the proper files?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900