gaurav kumar

gaurav kumar

  • NA
  • 11
  • 4.4k

i want to call webmethod on dropdown item change in asp .net

Jan 22 2015 1:11 AM
i have bind one dropdown list using json  ,its work good , but i want to fill value in text box on calling webmethod  on changing dropdown item  in asp.net
i have write code but its not working so, please post right way
and my code is
here
<script type="text/javascript">
///Get value in
$(document).ready(
$(function () {
$('#<%=DdlBusinessPlan.ClientID%>').change(function () {
var StateID = $("#DdlBusinessPlan > option[@selected]").attr("value");
if (StateID != 0) {
$.ajax({
type: "POST",
url: "PinGeneratemaster.aspx/GetPointValue",
contentType: "application/json; charset=utf-8",
data:'{Id: ' + $('#<%=DdlBusinessPlan.ClientID%>').val() + '}', // { Id: +StateID },
datatype: "json",
success: function (data) {
$("#<%=txtPoint.ClientID %>").html(value .results);
// $("#<%=txtPoint.ClientID %>").val (data.results);
},
error: function (result) {
alert("Error");
}
});
}
});
});
</script>
 

Answers (1)