my javascript code
$().ready(function () {
$.ajax({
type: "POST",
url: "../WebService.asmx/GetDistricts",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
BindDist(msg.d);
}
});
});
as
function BindDist(msg) {
$.each(msg, function () {
$("#dropDist").append($("<option></option>").val(this['DistrictId']).html(this['Name']));
});
}
in server side i want to get value by dropDist.selectedItem.but i can't get value how to do it.
int DistrictId = Int32.Parse((dropDist.SelectedValue).ToString());
how i get the dropdown selected value in server side?any help me is highly appreciated.