Reputation: 13
All guids I try using cascade dropdown lists States and Cities but return "undefined" Model file States.cs :
after run project and select a state show this result:
Upvotes: 0
Views: 565
Reputation: 36615
Please add console.log(cities)
to check the response:
$.each(data, function (i, cities) {
console.log(cities); //add this...
items += "<option value='" + cities["citiesId"] + "'>" + cities["cityName"] + "</option>";
});
Then you will find the property name in response is camel case.
So you need change code like below(e.g change cities["CitiesId"]
to cities["citiesId"]
):
items += "<option value='" + cities["citiesId"] + "'>" + cities["cityName"] + "</option>";
Upvotes: 1