Sys.WebForms.PageRequestManagerTimeoutException The server request timed out

less than 1 minute read

Few days ago I found an error when tried to export about 500 reports to pdf. The error is Sys.WebForms.PageRequestManagerTimeoutException The server request timed out. This is not found as exception. It is found on run time as javascript error. I was working on Ajax Control tool kit 3.5. It is occurred because export operation of 500 reports to pdf were relatively long time than default

How to solve this problem?

AsyncPostBackTimeOut is a property of ScriptManager of Ajax. You can change time out length. To solve this problem I have increased the time out of AsyncPostBackTimeOut property.

For example, for exporting 100 pdf I need 20 minutes. So, I will use maximum time out limit 20 minutes which is exactly 1200 seconds. My code is like below.

<asp:ScriptManager ID="ScriptManager1" AsyncPostBackTimeOut="1200" runat="server" />

**The default value of the AsyncPostBackTimeOut property is 90 seconds. For long time running method (Suppose a method will run for more than 90 seconds), you should use web service by setting timeout (number of seconds) of that web method by Javascript.