Chinna Netha

Chinna Netha

  • NA
  • 282
  • 137.4k

how to write Jquery Ajax and Josn in Asp.Net Web Form?

Jun 2 2015 11:26 AM
<script type="text/javascript">    
$(document).ready(function () {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Bind/BindDatatable",
data: "{}",
dataType: "json",
success: function (data) {
for (var i = 0; i < data.d.length; i++) {
$("#gvDetails").append("<tr><td>" + data.d[i].UserId + "</td><td>" + data.d[i].UserName + "</td><td>"
 + data.d[i].Location + "</td></tr>");
}
},
error: function (result) {
alert("Error");
}
});
});
</script>

After Page Loading Error will came ...plz help me...
Hide Copy Code
url: "Bind/BindDatatable",
------>how to write this line code
iam using web forms....

Answers (2)