使用 JSON JavaScriptSerializer 进行序列化或反序列化时出错。字符串的长度超过了为 maxJsonLength 属性设置的值。

解决办法是在web.config增加如下节点到<configuration>下

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

亲测可用。

原文地址:https://www.cnblogs.com/worf/p/5993151.html