vishal singh

vishal singh

  • NA
  • 55
  • 16.8k

Grid view bind problem using json

Sep 5 2016 6:29 AM
Hello friends i have a cod for binding grid view its working fine when i get value in alert but not appending in grid view
after appending grid view still showing empty
Tell me what i am doing wrong my code given below
 
function savekeyword() {
$.ajax({
type: "POST",
url: "add-manage-keywords.aspx/savekeyword",
data: "{'category':'" + $("#<%=catdrop.ClientID %>").val() + "','keyword':'" + $("#Text1").val() + "','status':'" + $("#sta").val() + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (a) {
GetCustomers();
},
});
};
function GetCustomers() {
$.ajax({
type: "POST",
url: "add-manage-keywords.aspx/GetCustomers",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
debugger;
$("#gvCustomers").find("tr:gt(0)").remove();
for (var i = 0; i < result.d.length; i++) {
$("#gvCustomers").append("<tr><td>" + result.d[i].keyword + "</td><td>" + result.d[i].category + "</td><td>" + result.d[i].catid + "</td><td>" + result.d[i].status + "</td></tr>");
}
},
error: function (result) {
alert("Error");
}
});
}
 

Answers (1)