Problme in JsonResult
- by Saravanan I M
I am using the jasonresult for listing all the cities under a country. I retrieve the data from database and load it to a dropdown list using jquery. The problem is if the cities goes beyond 3000 then the jasonresult is not working.
$(document).ready(function () {
//Hook onto the MakeID list's onchange event
$("#Country").change(function () {
//build the request url
$("#HomeTown").empty();
var url = '' + "Location/GetCitiesByCountry/" + $("#Country").val();
$.getJSON(url, function (data) {
$.each(data, function (index, optionData) {
$("#HomeTown").append("" + optionData.asciiname + "");
});
$("#HomeTown").option[0].selected = true;
});
}).change();
});