0

In ASP.NET MVC application,ajax call is used to fetch data in JSON format. This ajax call is working fine for small JSON data size.

Getting below error on AJAX call, when ajax call returning large size of JSON data.

Failed to load resource: the server responded with a status of 500 (Internal Server Error) send @ jquery.min.js:4

Also tried maxJsonLength property to a higher value in web.config (jsonSerialization maxJsonLength="2147483644") to resolve the issue.But it is not working.

Is there any other solution available to resolve this issue?

  • If you can not fix the problem by altering the property maxJsonLength then there must be an error at server side while doing JSON serialization. Provide more info in the question. – Venu prasad H S Jan 11 '18 at 05:52
  • if the size is larger than 2147483644, why don't you break it to few pieces instead of whole chunk at once? – Se0ng11 Jan 11 '18 at 05:59
  • Check the server logs to get more details about the error. – lofihelsinki Jan 11 '18 at 06:02
  • @VenuprasadHS On server side, i am able to do serialization properly by using JsonConvert.SerializeObject() method. While catching that JSON data on client side i am getting error. – pravinvankudre Jan 11 '18 at 07:06
  • @Se0ng11 I am converting DataTable into JSON so I can not break the data into chunks. I need whole dataTable json at once for further manipulation in JavaScript. – pravinvankudre Jan 11 '18 at 07:20
  • is the size reached 2147483644? if not, then something is wrong with the config, maybe restart the iis? – Se0ng11 Jan 11 '18 at 08:16
  • @Se0ng11 No.This Ajax call getting failed,when size of JSON data length more 1500000 chars.Can you please suggest me config changes. – pravinvankudre Jan 11 '18 at 09:23
  • ur size is huge, but still, not ever each to the limit that you set, so i suspect ur changes is not correct or u need to restart the iis, else there is another error that you might need to check, check this https://stackoverflow.com/questions/1151987/can-i-set-an-unlimited-length-for-maxjsonlength-in-web-config – Se0ng11 Jan 11 '18 at 09:26

0 Answers0