Is it possible to use DataTables's ajax in ASP.NET Webforms?
Is it possible to use DataTables's ajax in ASP.NET Webforms?
As you might know, ASP.NET gives ajax response with d
parameter. I tried to alter this with:
dataSrc: function (json) {
return json.d.data;
}
But when I run it, it shows jquery.dataTables.js:4108 Uncaught TypeError: Cannot read property 'length' of undefined(…)
. As you can see on the image I attached within this post. I checked in that part and it seems like dataSrc doesn't really alter all the response.
this what I did for the DataTables's ajax option:
dataTable: {
ajax: {
type: 'POST',
url: window.location.href + '/GetData',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
dataSrc: function (json) {
return json.d.data;
},
..... //other options
}
So, I just want to make sure. Is it possible to use DataTable's ajax in Webforms regarding this response matter? If yes, is there any other option to alter all the responses that will be handled by DataTables?