2 Datatables with Ajax throwing Ajax error for datasets over certain size
2 Datatables with Ajax throwing Ajax error for datasets over certain size
My scenario is as follows :
I have 2 datatables on my page that each obtain their datasets via an ajax request to the server the first time they load. Each datatable has its own url for ajax request.
The first datable loads fine with +/- 600 records. I have not tried it with more.
- The second one loads fine with up to 650 records. If a dataset with more than 650 records is passed to the datatable I get the 'Ajax error' i.e. tn/7
- I have deferred render set to true.
How do I get around this issue ? I know that client side processing can handle many more than 10000 records so I cannot understand why I am getting this error for such a small dataset. I have tried to obtain the last json dataset that's passed to the client . The last json response is {"C":"d-77390DCB-CZ,0|Co,D|Cp,0","M":[]}
Thanks in advance.
This question has an accepted answers - jump to answer
Answers
We'd really need a link to the page showing the issue to be able to help debug it, or more information. For example, what is the status code returned from the server for each Ajax request? What is the data in each Ajax request? Does the server's error log show any informaiton?
Allan
Hi Allan,
Thanks for the response. Information logged to the console is below.
Hi all,
After doing some more debugging and checking around I have realized the following :
The issue is due to the dataset being larger than the default value configured in ASP.NET MVC.
Changing the maximum json length in the controller method solved the problem.
These links explain in more detail :
stackoverflow.com/questions/15288367/increase-json-response-maxjsonlength-in-mvc-4
stackoverflow.com/questions/1151987/can-i-set-an-unlimited-length-for-maxjsonlength-in-web-config/1151993#1151993
Once again, thanks for looking at my question and replying.
Cheers
Thanks for posting back.. Great to hear that you've found the issue and the solution.
Allan