Wednesday, December 03, 2008

How to specify maxJsonLength property in web.config


If you're getting the following exception while using JavaScriptSerializer:
"Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property." - you may enlarge the default maxJsonLength value in web.config:

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



1 comment:

Anonymous said...

Cheers!