只要修改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 ">
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。