1

I have a variable varstore which is being sent to the controller from the view using JSON. The problem with the variable is that it can have very long strings somewhere near 30000 characters. My JSON script is as follows

$.ajax({
    url: "../Home/GridSubmit",
    data: { "ddlstore": varstore, },
    contentType: "application/json; charset=utf-8",
    traditional: true
})

I have the web.config configured to the following;

<webServices>
    <jsonSerialization maxJsonLength="2147483644"/>
</webServices>
<httpRuntime maxQueryStringLength="500000" maxRequestLength="500000"/>`

Upon hitting the action button, I get the following error:

An error occured Error request-URI too Long

Please help

Debashis Paul
  • 27
  • 2
  • 2
  • 6
  • 7
    don't use GET. use POST instead, which has no practical limits on content size. URLS are deliberately length-limited, to prevent abuses such as what you're doing: stuffing the contents of the encyclopedia britannica in a url. – Marc B Apr 01 '15 at 21:22
  • Try this http://stackoverflow.com/questions/10966328/getting-the-json-request-was-too-large-to-be-deserialized – Babak Fakhriloo Apr 01 '15 at 21:29
  • or this http://stackoverflow.com/questions/15288367/increase-json-response-maxjsonlength-in-mvc-4 – Babak Fakhriloo Apr 01 '15 at 21:33

0 Answers0