To Increase Request Timeout only on particular Web

2019-04-27 12:07发布

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.

2条回答
萌系小妹纸
2楼-- · 2019-04-27 12:35

Use Web.config:

<location path="Page.aspx">
    <system.web>
        <httpRuntime executionTimeout="180"/>
    </system.web>
</location>
查看更多
劳资没心,怎么记你
3楼-- · 2019-04-27 12:35

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.

查看更多
登录 后发表回答