in web.config of web service that returns more than 40,000 records I have set maxlength for json serialization
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="50000000"/>
</webServices>
</scripting>
</system.web.extensions>
function BindInfoDataTableServerSide()
{
var oTable = $('#example').dataTable({
"sScrollY": "250px",
'bPaginate': true,
"bProcessing": true,
"bFilter": false,
"bServerSide": true,
//"aoColumns": [null, null, { "bSortable": false }, { "bSortable": false}, null, null, null, null],
/* "aoColumns": [
{ "sTitle": "ScreenId" },
{ "sTitle": "RunId" },
{ "sTitle": "RecordType" },
{ "sTitle": "TrackerKey" },
{ "sTitle": "SeqNo" },
{ "sTitle": "TRSeqNo" },
{ "sTitle": "TestParam" },
{ "sTitle": "ParamValue" },
]
,*/
"sAjaxSource": "../SocWebService.asmx/LoadMidasData",
"sAjaxDataProp": "aaData",
"fnServerData": function (sSource, aoData, fnCallback) { GrabData(sSource, aoData, fnCallback); }
});
}
function GrabData(sSource, aoData, fnCallback) {
$.ajax({
type: "POST",
url: sSource,
contentType: "application/json; charset=utf-8",
dataType: "json",
data: "",
success: function (result) {
var myObject = JSON.parse(result.d);
fnCallback(myObject);
//fnCallback(result.d);
},
error: function (errMsg) {
alert(errMsg);
}
});
}
But when records go to 50,000 then I run into following Error
during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property. Jquery datatables website claim they can display 1 million records. Am I missing something ?