locked
Ajax Data Table error RRS feed

  • Question

  • User718865757 posted

    Hi,

    Im using http://www.datatables.net/ this data table in my MVC application. My DB has huge number of records like 1 lakh above, But this datatable accepting only 5423 Rows.

    If i pass >=5424 Rows to that data table, Im getting below error. I searched a lot but couldn't find the solution for this.

    Please Help.

    Thanks,

    Shivanag.

    Tuesday, December 2, 2014 2:24 AM

Answers

  • User718865757 posted

    Hi thanks for the reply,

     I got the solution. The issue is with JSON data. Now i fixed it by giving it maxsize.

    Thanks.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 2, 2014 6:27 AM

All replies

  • User1401801381 posted

    Hi

    it's possible that you have a limit in the data you get using ajax 

    you can do paging or you can set a bigger size for the response (see here for the json serialization : http://msdn.microsoft.com/en-us/library/bb763183.aspx)

    Tuesday, December 2, 2014 5:12 AM
  • User718865757 posted

    Hi thanks for the reply,

     I got the solution. The issue is with JSON data. Now i fixed it by giving it maxsize.

    Thanks.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 2, 2014 6:27 AM
  • User-333307449 posted

    Hi Shivnag,

    This can be fixed.  JSON supports a particular size of record by default. but if we are trying to return more records, you have  to specify the MaxJsonLength property of Json object.

    To do so.  Go to your Controller first then go to the code where you are returning JSON record, and replace your old code by following code:

    var jsonResult = Json(new { aaData = finalList }, JsonRequestBehavior.AllowGet);
     jsonResult.MaxJsonLength = int.MaxValue;
     return jsonResult;
    Wednesday, December 3, 2014 9:14 AM