using this code in mvc
In view
<script>
$(function () {
//Dropdownlist Selectedchange event
$("#ContId").change(function () {
$.get("/Home/GetStateById", { ID: $("ContID").Val() }, function (data) {
$("#St").empty();
$.each(data, function (index, row) {
$("#St").append("<option value='" + row.ID + "'>" +
row.Statename + "</option>");
// here we are adding option for States
});
})
});
});
</script>
but this is not working plz check this code there is an exception coming at this line .
$.get("/Home/GetStateById", { ID: $("ContID").Val() }, function (data) {