Accepted answer

You webserver will limit the maximum response size limit. You should refer to documentation on your web server of choice to see how best to increase that limit beyond whatever it is set to today.

The JsonResult class does have a property (maxJsonLength) you may also try changing

var jsonResult = Json(dataPlot, JsonRequestBehavior.AllowGet);
jsonResult.MaxJsonLength = int.MaxValue;
return jsonResult;

Possible configuration change

                 <jsonSerialization maxJsonLength="1000000" />                 

Most importantly - you may want to reconsider your call to limit or somehow partition the responses into more manageable chunks as a default response limit is fairly large and can take a long time to return (network latency)

Generally speaking it's usually not a good idea to increase your response size limit. But that is probably the problem you are experiencing.


MaxJsonLength: This helps to get or set the maximum JSON content length that you will send. The default value for this is 2097152 characters, that is equal to 4 MB of Unicode string data. You can even increase the size based if needed, for that you will get an idea later in this article


protected override JsonResult Json(object data, string contentType,Encoding contentEncoding, JsonRequestBehavior behavior)


    return new JsonResult()


    Data = data,

    ContentType = contentType,

    ContentEncoding = contentEncoding,

    JsonRequestBehavior = behavior,

    MaxJsonLength = Int32.MaxValue




var jsonResult = Json(dataPlot, JsonRequestBehavior.AllowGet);    
jsonResult.maxJsonLength = int.MaxValue;    
return jsonResult;

This is a best way to crease data limit in post.

Related Query

More Query from same tag