Introduction:
Here I will explain how to insert and display data using web service with java-script
While you can call method with jquery ajax call:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"
type="text/javascript"></script>
<script type ="text/javascript">
$(document).ready(function () {
$('#<%=Button1.ClientID
%>').click(function () {
$.ajax({
type: "POST",
url: "WebForm1.aspx/ServerSideMethod",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function (msg) {
$('#myDiv').text(msg.d);
}
})
return
false;
});
});
</script>
0 comments :
Post a Comment