jquery - How to increase the json size limit for ASP.NET WebAPI Post call? -
my form on page little large. collects monthly measurement data. please take @ sample:
{ "year":2013, "month":3, "records":[ {"id":0,"date":"3/1/2013","riversection":5,"usernumber":56}, {"id":0,"date":"3/1/2013","riversection":7,"usernumber":200}, {"id":0,"date":"3/1/2013","riversection":8,"usernumber":556}, {"id":0,"date":"3/2/2013","riversection":5,"usernumber":56}, {"id":0,"date":"3/2/2013","riversection":7,"usernumber":200}, ... ... {"id":0,"date":"3/31/2013","riversection":7,"usernumber":200} }
so posting big data apicontroller.
i works fine in local machine using visual studio debugger server. after uploaded code server (iis 6). gives 500 internal server error
.
i tried posting sample data , checked length of stringified json.
in 1 sample data set, length of json 5743, , got "success". if json size goes 17345, got 500 internal server error
.
so tried increase limit of json. base on this post
in web.config
:
<system.web.extensions> <scripting> <webservices> <jsonserialization maxjsonlength="5000000"> </jsonserialization> </webservices> </scripting> </system.web.extensions>
but not working.
there answer, using:
var serializer = new javascriptserializer(); serializer.maxjsonlength = int32.maxvalue;
but should place code? in global.asax
?
please note using iis 6. problem? how can correctly increase limit of json size data can hit webapi action?
thank assistance.
try adding aspnet:maxjsondeserializermembers
under appsettings
in web.config
<add key="aspnet:maxjsondeserializermembers" value="20000"/>
source: an asp.net request has lots of form keys, files, or json payload members fails exception
Comments
Post a Comment