首页 > 代码库 > jQuery Ajax 请求报长度过长的错误:Error during serialization or deserialization using the JSON JavaScriptSerializer

jQuery Ajax 请求报长度过长的错误:Error during serialization or deserialization using the JSON JavaScriptSerializer

 {"Message":"Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set

 

在web项目的web.config <configuration>节下增加

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

 

另外如果 web项目 请求WCF服务长度过长报错的话

 

在web.config  <system.web>节下增加

<httpRuntime maxRequestLength="250000"/>