在asp.net mvc中,实体序列化成JSON对象时,若实体过大,则会报错,需要在web.config中加入以下内容。
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="2147483644"/>
</webServices>
</scripting>
</system.web.extensions>
<appSettings>
<add key="aspnet:MaxJsonDeserializerMembers" value="15000000" />
</appSettings>
本文介绍在ASP.NET MVC中解决实体序列化为JSON时因实体过大导致的问题,通过修改web.config文件来增加JSON序列化的长度限制和成员数量。
1706

被折叠的 条评论
为什么被折叠?



