In the Script tag :
<script type="text/javascript">
$(document).ready(function () {
$("#CountryID").change(function () {
// alert("Hi");
var url = '@Url.Content("~/")' + "UserInfo/BindCity";
var ddlSource = "#CountryID";
var ddlTarget = "#Cities";
$.getJSON(url, { c: $(ddlSource).val() }, function (data) {
$(ddlTarget).empty();
$.each(data, function (index, optionData) {
$(ddlTarget).append("<option value='" + optionData.Value + "'>" + optionData.Text + "</option>");
});
});
});
});
</script>
In the Razor View
<td>
<div class="editor-label">
@Html.Label("Country")
</div>
<div class="editor-field">
@Html.DropDownList("CountryID", (IEnumerable<SelectListItem>)ViewData["Ct"],
new { id = "CountryID" })
<br />
@* @Html.ValidationMessageFor(model => model.ContactNo)*@
</div>
<div class="editor-label">
@Html.Label("City")
</div>
<div class="editor-field">
@Html.DropDownList("Cities")
</div>
</td>
Its Work Fine For me....
try this out..
Best Of Luck....