加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

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

发布时间:2020-12-17 02:06:54 所属栏目:安全 来源:网络整理
导读:只要修改web.config,在microsoft.web?scriptingwebServices中定义一下他的长度到足够大就可以了。比如: jsonSerialization maxJsonLength="500000"/jsonSerialization 如: ? system.web.extensions ?????? scripting ?????????? webServices ??????? json

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

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


如:

?

< system.web.extensions >

?????? < scripting >

?????????? < webServices >

??????? < jsonSerialization maxJsonLength = "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 >

上面设置了:< jsonSerialization maxJsonLength = "10240000 ">


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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读