增加每页级别的 ASP.Net 超时
是否可以增加单个 ASP.net 页面的超时时间。我知道这在服务器级别是可能的,但是在页面级别可能吗?
单个报告页面吗?
我需要这个用于需要 2-3 分钟才能加载任何想法的
Is it possible to increase the timeout for a single ASP.net page. I know it is possible at the server level, but is it possible at thepage level?
I need this for a single report page that takes 2-3 minutes to load
any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为您正在寻找的是
ScriptTimeout
。您可以像这样在页内设置:超时值以秒为单位。
另外,请注意,如果您在调试模式下运行,这将被忽略并且超时设置为最大值;不过,我认为这对您来说不是问题,因为您是在增加超时,而不是减少超时。
I think what you're looking for is
ScriptTimeout
. You can set this in-page like this:The timeout value is in seconds.
Also, be aware of the fact that if you are running in debug mode, this gets ignored and the timeout is set to the maximum; I don't think that's an issue for you anyway though, as you're increasing the timeout, not decreasing it.
根据 此页面,我也可以验证,这是实现的另一种好方法这是为了将其添加到您的配置的
configSection
中:然后,您还可以添加其他属性,例如
maxRequestLength="204800"
或其他部分,例如:希望这有帮助。
As per this page, and I could verify too, another good way to achieve this is to add this to your config's
configSection
:You could then also add other attributes like
maxRequestLength="204800"
or other sections, like:Hope this helps.
我发现我的问题通过增加 SQL 超时得到解决,
使用command.CommandTimeout = 100;
例子:
Ive found my problem was resolved by increasing the SQL timeout,
using
command.CommandTimeout = 100;
example: