I have an ajax function which works correctly
$.ajax({
type: "POST",
url: urlemp,
success: function (returndata) {
if (returndata.ok) {
// var data = eval("" + returndata.data + "");
select.empty();
$.each(returndata.data, function (rec) {
select.append($('<option>' + returndata.data[rec].Name + '</option>'));
});
select.show('slow');
select.change();
}
else {
window.alert(' error : ' + returndata.message);
}
}
}
);
and in the view I use this selector code
<select id="cmbDept" onload="javascript:cascadingdropdown()">
</select>
Now I would like to change the code of this selector to Razor type like @Html.xxxx
How can i do that ?
try something like this:
Controller: