I have a dropdown and need to dynamical load form elements based on a statement
Following code gets the data via ajax call for OnChange Event and fills another DropDown
$("#IdOfyourDropDown").change(function () {
$.getJSON('<%= ResolveUrl("~/PutYourURL/?Id="1)%>', function (data)
{
Result = data; //Use this data for further creation of your elements.
var items = "";
items += "";
$.each(data, function (i, SingleElement) {
items += "";
});
$("#AnyOtherDropDown").html(items);
});
});
I used getJSON to retrieve the data, you can use many more