【问题标题】:serialization-maxJsonLength web.config error序列化-maxJsonLength web.config 错误
【发布时间】:2011-03-14 15:27:50
【问题描述】:

序列化 c# 对象列表时遇到问题。

当我通过 .ajax 调用 web 服务时,出现一个错误,提示长度已超过..

为了避免这个错误,我更改了我的 web.config,在开头添加如下:

       <configuration>

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

现在我在启动我的 asp.net 应用程序时遇到错误 “system.web.extensions 未知”?

【问题讨论】:

  • 我已经更改了 webconfig 中的 位置。我把它放在了 之后。工作正常。没有 json 错误

标签: asp.net web-services json web-config


【解决方案1】:
  <system.web.extensions>
    <scripting>
      <scriptResourceHandler enableCompression="true" enableCaching="true"/>
      <webServices>
        <jsonSerialization maxJsonLength="50000000"/>
      </webServices>
    </scripting>
  </system.web.extensions>

这对我有用。标签顺序错误。

【讨论】:

    猜你喜欢
    • 2016-08-11
    • 2012-09-26
    • 2013-12-29
    • 2014-09-15
    • 1970-01-01
    • 1970-01-01
    • 2023-04-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多