惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
Engineering at Meta
Engineering at Meta
腾讯CDC
宝玉的分享
宝玉的分享
H
Help Net Security
I
InfoQ
博客园 - Franky
The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Microsoft Security Blog
Microsoft Security Blog
M
MIT News - Artificial intelligence
博客园_首页
美团技术团队
Recent Announcements
Recent Announcements
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
The Cloudflare Blog
博客园 - 司徒正美
Vercel News
Vercel News
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
月光博客
月光博客

博客园 - 大白鲨

javascript的数组使用方法 - 大白鲨 - 博客园 asp.net操作Excel拒绝访问的解决 利用javascript判断浏览器是否已经安装ActiveX控件和是否禁止运行ActiveX控件 IIS错误Server Application Error(http 500 错误)解决办法 SQL Server的SQL技巧 ASP.NET 2.0 实现多文件上传 网络MSDTC配置方法 visual studio 2005包加载失败的解决办法 Office Excel 2003找不到安装文件sku011.cab的解决办法 delphi连接DCOM的安全配置 Atlas中对DataTable操作的脚本 去掉asp.net2.0的树控件刷新功能 通过Web Services上传和下载图片文件 IIS 5.0错误解决集锦 访问IIS时返回的状态代码解释参考 使用UDPClient 编写聊天程序 Windows安全配置技术 为IIS配置安全的发布方法 SQL Server中各个系统表的作用
"Maximum length exceeded"错误的解决办法 - 大白鲨
大白鲨 · 2008-01-24 · via 博客园 - 大白鲨
   

只要修改web.config,在<microsoft.web> <scripting><webServices>中定义一下他的长度到足够大就可以了。比如:

<jsonSerialization maxJsonLength="500000"></jsonSerialization>

如:

<system.web.extensions>

       <scripting>

           <webServices>

        <jsonSerializationmaxJsonLength="10240000">

          <!--<converters>

            <add name="WebService" type="System.Web.Services.WebService"/>

          </converters>-->

        </jsonSerialization>

              <!-- Uncomment this line to customize maxJsonLength and add a custom converter -->

              <!--

      <jsonSerialization maxJsonLength="500">

        <converters>

          <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>

        </converters>

      </jsonSerialization>

      -->

              <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->

              <!--

        <authenticationService enabled="true" requireSSL = "true|false"/>

      -->

              <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved

           and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and

           writeAccessProperties attributes. -->

              <!--

      <profileService enabled="true"

                      readAccessProperties="propertyname1,propertyname2"

                      writeAccessProperties="propertyname1,propertyname2" />

      -->

           </webServices>

           <!--

      <scriptResourceHandler enableCompression="true" enableCaching="true" />

      -->

       </scripting>

    </system.web.extensions>

上面设置了:<jsonSerializationmaxJsonLength="10240000">

这是解决ajax传输字节数大于默认值时的设置。

如果对于页面出错配置如下:

<httpRuntime    

     executionTimeout="1200"    

     maxRequestLength="102400"    

     useFullyQualifiedRedirectUrl="false"    

     minFreeThreads="8"     

     minLocalRequestFreeThreads="4"    

     appRequestQueueLimit="100" 

    />