大白鲨博客

欢迎讨论.Net技术、delphi技术、C++等技术(我的QQ号:353079102)

导航

"Maximum length exceeded"错误的解决办法

   

只要修改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" 

    />

posted on 2008-01-24 21:25  大白鲨  阅读(3788)  评论(0编辑  收藏  举报