score:15

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

<configuration>
    <system.web.extensions>
        <scripting>  
             <webservices>                                                   
                 <jsonserialization maxjsonlength="1000000" />                 
             </webservices>
        </scripting>
    </system.web.extensions>
</configuration>

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.

score:0

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

solutions:

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

    };

    }

score:1

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