[英]Increasing maximum response size from ASP.NET Page Method
I've got a page method on an ASPX page that gets called by a jQuery AJAX POST request. 我在ASPX页面上有一个页面方法,可以通过jQuery AJAX POST请求调用。 When I try to return too many results, the request fails. 当我尝试返回太多结果时,请求失败。 Is there a web.config setting or class attribute I can use to increase the default maximum response size? 是否有web.config设置或类属性我可以用来增加默认的最大响应大小?
I am assuming you are returning JSON? 我假设你正在返回JSON?
You can adjust the JSON response size in the web.config with: 您可以使用以下命令调整web.config中的JSON响应大小:
<configuration>
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="1000000" />
</webServices>
</scripting>
</system.web.extensions>
</configuration>
Doing a quick search, it looks like the default size is 102400. 进行快速搜索,看起来默认大小为102400。
maxJsonLength Optional attribute. maxJsonLength可选属性。
Configures the maximum length of the JSON string (the maximum number of UTF-8 characters). 配置JSON字符串的最大长度(最大UTF-8字符数)。
The default length is 102400. 默认长度为102400。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.