Wednesday, January 8, 2014

How to solve "Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property"?


 The default value for JavaScriptSerializer is 102400. Need to change before using:
             
JavaScriptSerializer serializer = new JavaScriptSerializer();
serializer.MaxJsonLength = int.MaxValue;

Reference:
http://msdn.microsoft.com/en-us/library/system.web.configuration.scriptingjsonserializationsection.maxjsonlength.aspx


No comments:

Post a Comment