Hello,
I have been trying to get data into PQ grid from a asp.net web form with a webmethod using the "remote" option. However my call is never reaching the server webmethod bindGrid1. I would appreciate if you could tell me where I am going wrong. I am getting alert for "1a" but no alert for "1b" and the method is also not getting called on the server. Please see the code below
JavaScript:
obj.dataModel = {
location: "remote",
sorting: "local",
paging: "local",
dataType: "JSON",
method: "GET",
curPage: 1,
rPP: 10,
getUrl: function () {
alert("1a");
return { url: "F1845.aspx/bindGrid1"
};
},
getData: function (dataJSON) {
alert("1b");
var data = dataJSON.data;
return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: data };
//return { data: data };
}
};
VB.net in ASP.net class F1845:
<WebMethod()> Public Shared Function bindGrid1() As String
Dim objquries As Quries
Dim ds As New DataSet()
Dim dt As New DataTable()
Dim scriptString As String = ""
objquries = HttpContext.Current.Session.Item("login")
ds.Clear()
svkstx$ = "QW24 '" & objquries.getId() & "'"
ds = objquries.dsgrid(svkstx$)
dt = ds.Tables(0)
svkstx$ = Module1.GetJson(dt)
sb$ = "{""totalRecords"":10, ""curPage"":1,""data"": " & svkstx$
svkstx$ = svkstx$ + "}"
Return svkstx$
End Function