Here is my view
@Html.LabelFor(Function(m) m.City)
@Html.DropDownListFor(Function(m) m.City, New SelectList(Model.citylst, "CityId", "CityName"), "--Select--")
@Html.LabelFor(Function(m) m.Country)
@Html.DropDownListFor(Function(m) m.Country, New SelectList(Model.statelist, "stateid", "CountryName"), "--Select--")
Controller:-
For city when state is selected :-
If i IsNot Nothing Then
Dim vs1 = From fr In dbpra.CityMasters _
Where fr.StateID = str _
Select fr.CityName, fr.CityId
For Each fr1 In vs1
citylst.Add(New CityMaster With {.CityId = fr1.CityId, .CityName = fr1.CityName})
Next
End If
For state:-
Dim vs = From sta In dbpra.StateMasters
Select New With {sta.StateId, sta.StateName}
For Each fr In vs
statelist.Add(New StateMaster With {.StateId= fr.StateId, .StateName= fr.StateName})
Next
And use this jquary
$(document).ready(function () {
$("#StateId").change(function () {
var url = "/User/Users";
var first = $(this).val();
$.post(url, { Value: first }, function (data) {
// alert(data.CityId);
// alert(data.CityName);
alert(data);
});
});
});
its work but there is no change on view