To Increase Request Timeout only on particular Web Page

99封情书 提交于 2020-01-02 02:41:06

问题


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. Thanks.


回答1:


Use Web.config:

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



回答2:


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.

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 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.

The debug="false" bit is probably what is afflicting the gentleman above who was having issues on his Amazon Server, but not locally.

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.



来源:https://stackoverflow.com/questions/15127756/to-increase-request-timeout-only-on-particular-web-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!