I\'m trying to create some cascading dropdown lists in asp.net. The lists are populating correctly on page load:
Add contentType:'application/json' in your ajax call.
$.ajax({
type: 'POST',
url: '@Url.Action("GetRegionsByCountryCode")',
dataType: 'json',
contentType:'application/json'
data: { countryCode: $("#Country").val() },
success: function (data) {
$.each(data, function (index, value) {
$("#Regions").append('');
});
},
error: function (ex) {
alert('Failed to retrieve regions.' + ex);
}
});