简体   繁体   English

仅在特定网页上增加请求超时

[英]To Increase Request Timeout only on particular Web Page

Is it possible to increase the request timeout for just the one particular web page? 是否可以仅增加一个特定网页的请求超时? I am working on ASP.Net 4.0 and I need one particular page to have a longer request timeout, since it is responsible for initiating a long running process. 我正在研究ASP.Net 4.0,我需要一个特定的页面才能有更长的请求超时,因为它负责启动一个长时间运行的进程。 Thanks. 谢谢。

Use Web.config: 使用Web.config:

<location path="Page.aspx">
    <system.web>
        <httpRuntime executionTimeout="180"/>
    </system.web>
</location>

This is an old thread, but it should be emphasized that updating the executionTimeout of a page or the entire machine must also be accompanied by the compilation debug flag being set to "false", otherwise the timeout element is ignored. 这是一个旧线程,但应该强调的是,更新页面或整个机器的executionTimeout还必须伴随着编译调试标志设置为“false”,否则忽略timeout元素。

Also, depending on whether or not you are using AJAX update panels, you may also have to look at the AsycPostBackTimeout flag on the ScriptManager itself - depends on how your timeout is manifesting itself. 此外,根据您是否使用AJAX更新面板,您可能还必须查看ScriptManager本身的AsycPostBackTimeout标志 - 取决于超时如何显示。 Ajax post back timeouts will be seen as error messages logged to the Javascript Console and tend to manifest themselves as ajax operations "dying on the vine" depending on how you are handling things. Ajax回发超时将被视为记录到Javascript控制台的错误消息,并且往往表现为ajax操作“死在藤蔓上”,具体取决于您处理事物的方式。

The debug="false" bit is probably what is afflicting the gentleman above who was having issues on his Amazon Server, but not locally. debug =“false”位可能正在困扰上面那位在他的亚马逊服务器上遇到问题的绅士,而不是在本地。

Some googling will also reveal that some folks have noticed that localhost handles things differently as well, so you may need to experiment around that. 一些谷歌搜索也会发现有些人已经注意到localhost也处理不同的事情,所以你可能需要试验一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM