JSON Serialization maxJsonLength

In a number of situations, passing JSON objects between server side and client is a dream come true for developers. It makes integration between the two worlds quite nice. However, sometimes those JSON objects can be quite large in a Ajax request. Eventually you will hit a default limit and your Ajax request will just straight up fail. The object is too big. This is a simple fix though; adjust your web.config settings for a new limit (in characters):

 <system.web.extensions>

    <scripting>

      <webServices>

        <jsonSerialization maxJsonLength=”1000000″ />

      </webServices>

    </scripting>

  </system.web.extensions>

Leave a Reply