今天无意中发现当选择某个国家&城市联动时,遇到Ajax返回数据之后无法填充City的问题,查看HttpWatch,
原来是:The length of the string exceeds the value set on the maxJsonLength property, 也就是返回
的Json数据的长度超过了默认的102400!
 因为DB的数据都是从原C/S系统导过来,冗余数据太多[CityName一样,CityCode不一样]导致某国家下面的城市
数高达2000+,所以返回的时候才出现上面问题.
只需在Web.config中修改maxJsonLength即可
<system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="250000">
        </jsonSerialization>
      </webServices>
    </scripting>
  </system.web.extensions> 

相关文章:

  • 2021-12-01
  • 2021-06-30
  • 2022-12-23
  • 2021-08-27
  • 2021-05-30
  • 2022-12-23
  • 2021-08-16
猜你喜欢
  • 2022-12-23
  • 2021-10-02
  • 2021-12-23
  • 2021-11-04
  • 2021-09-17
  • 2021-10-20
相关资源
相似解决方案