Error during serialization or deserialization using the JSON JavaScriptSerializer

Problem:

When I released my application on my live server I got the following error: System.InvalidOperationException-- Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property. This works fine on my local computer but above error is received only in Live server (IIS 7).  

Solution

You just need to configure the max length for json requests in your web.config file: MaxJsonLength property is an integer so the max value you can set is: 2147483644
<configuration>
   <system.web.extensions>
       <scripting>
           <webServices>
               <jsonSerialization maxJsonLength="2147483644"/>
           </webServices>
       </scripting>
   </system.web.extensions>
</configuration>