element
の on change イベントをバインドします。
$("#elementId").on("change",function(){
//This will return selected value
var selectedValue=$(this).("option:selected").val();
$.ajax({
type: 'POST',
url: 'WebForm1.aspx/getData',
data: '{ val:+'selectedValue+'}',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (msg) {
}
});
});
コード ビハインド ファイル:-
[WebMethod]
public static string getData(string val)
{
//Call your web-service with val as your selected drop down value
}
デモ: http://jsfiddle.net/hungerpain/ptZhF/1/