How can populate a ddl list dynamically (cascading ddl) using jquery w/o ms ajax framework or jquery plugins? (where I work am very limited on the libraries I can use). I am using ASP.Net with jquery accessing an asmx webmethod. The $.ajax call to the web method looks like the following:
function getText() {
$.ajax({
type: "POST",
url: "SearchFilters.asmx/HelloWorld",
dataType: "html", // also tried "text"
success: function(response) {
alert(response);
$("#ddlCase").html(response);
}
});
}
This return xml that looks like the following:
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/"><option value='1'>Hello World</option></string>
In the success function, the js only clears out the values of the ddl:
$("#ddlCase").html(response)
Can this be done? How can I decode the returned xml? What am I missing? Previously I attempted a datatype of json without success. Please refer to the following:
using JQuery .ajax, a Success method is not called when using jquery 'json' vs 'text'
Thanks! D
In the end the source of my issue was the lack of the [ScriptService] attribute on the class decoration. I changed to class declartion to:
Using Fiddler I discovered the following error message was returned: