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); } }); });
a
function BindDist(msg) { $.each(msg, function () { $("#dropDist").append($("<option></option>").val(this['DistrictId']).html(this['Name'])); }); }
on the server side, I want to get the value of dropDist.selectedItem.but, I can not get the value of how to do this.
int DistrictId = Int32.Parse((dropDist.SelectedValue).ToString());
how do i get the dropdown selected value on server side? Any help is greatly appreciated.
source share