从ASP.NET页面方法增加最大响应大小 [英] Increasing maximum response size from ASP.NET Page Method
问题描述
我有一个ASPX页面,被称为一个jQuery AJAX POST请求的页面的方法。当我尝试返回太多的结果,请求失败。有没有我可以用它来增加默认最大响应大小的web.config中设置或class属性?
I've got a page method on an ASPX page that gets called by a jQuery AJAX POST request. 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?
推荐答案
我假设你正在返回JSON?
I am assuming you are returning JSON?
您可以在web.config中调整JSON响应尺寸:
You can adjust the JSON response size in the web.config with:
<configuration>
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="1000000" />
</webServices>
</scripting>
</system.web.extensions>
</configuration>
做一个快速搜索,它看起来像默认大小为102400。
Doing a quick search, it looks like the default size is 102400.
maxJsonLength可选属性。
maxJsonLength Optional attribute.
配置的最大长度 JSON字符串(最大数量 UTF-8字符)。
Configures the maximum length of the JSON string (the maximum number of UTF-8 characters).
默认长度为102400。
The default length is 102400.
这篇关于从ASP.NET页面方法增加最大响应大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!