Search code examples
asp.netasp.net-mvcasp.net-mvc-3telerik-mvcjavascriptserializer

JavaScriptSerializer seems to ignore the maxJsonLength configuration


I was facing the max json length problem so as suggested by various sources on the internet, i increased the default json length in the configuration file like

<system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="900000000"></jsonSerialization>
      </webServices>
    </scripting>
  </system.web.extensions>

but the problem persisted. Then i came across a fantastic blog post that suggested to write my own ActionResult. i am using the telerik grid for mvc along with mvc3.net. Any idea why the serializer ignoring the config.


Solution

  • Having struggled with this myself, unfortunately, for now, this is the only solution.

    Also see this question and answer for more details: MaxJsonLength exception in ASP.NET MVC during JavaScriptSerializer