开发者

ASP.Net AJAX timeout although request is completing long before timeout duration

开发者 https://www.devze.com 2022-12-20 09:41 出处:网络
I have an ASP.Net application that makes an AJAX request to retrieve at report. The report can run for a long time so I set the asyncpostbacktimeout in <asp:ScriptManager /> to 600. However, whe

I have an ASP.Net application that makes an AJAX request to retrieve at report. The report can run for a long time so I set the asyncpostbacktimeout in <asp:ScriptManager /> to 600. However, when I try to run the report, if it runs for longer than 90 seconds it fails to come back. I 开发者_开发知识库can see in the IIS logs that the POST request succeeded with a 200 status and I can see the time taken is much less than 600.

The web page dutifully waits for the entire 600 seconds before returning with a timeout error:

Error: Sys.WebForms.PageRequestManagerTimeoutException: The server request timed out.

Is there any setting I should be checking in IIS? Connection timeout is 900 seconds.

Cheers, Iain


You are need to set the time out at a couple of places...

1) In IIS Website Connection Time out:

This is the time (in seconds) when elapsed server will disconnect the requesting client i.e. browser. Make sure the value is slightly greater then your requirement. Make sure to restart IIS after this.

2) In web.config <httpRuntime />

httpRuntime executionTimeout="1000"

This is the time (in seconds) when elapsed ASP.Net engine discontinue the execution of processing page cycle. Make sure this is set appropriately.

3) In web.config <sessionState timeout="20"/>

Make sure it's set appropriately. Default is 20 minutes so it shouldn't be in contrast with your value i.e. 600 seconds

4) <authentication mode="....." > In web.config the timeout (in seconds) value in your authentication property. If you are using any authentication/authorization

5) Finally Asyncpostbacktimeout attribute value (in seconds) in script manager

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号