DCSIMG
Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error - Wortzel's blog

Wortzel's blog

.Net (2.0, 3.0, 3.5), C#, Asp.net, Com+, GIS(ESRI Software), Management, Analysis & Design, Life, Trips, And more...
Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error

Last week I had a problem when I tried to export an image from the AGS 9.2 to a pdf file. I got this error: "Sys.WebForms.PageRequestManagerTimeoutException The server request timed out" from the Ajax Extension framework. Its occurred because the export operation was relatively long (something like 2 minutes) and the Ajax Extension Callback framework had a timeout.

How to solve this problem?
To solve this problem we can increase the timeout. You can change the timeout time by adding a new property to the script manager control. This property is called AsyncPostBackTimeOut and it can help us to define the number of seconds before the request will throw a request timeout exception*.

For example if you want that the timeout will take maximum 10 minutes your code should be look like this:

<asp:ScriptManager ID="ScriptManager1" runat="server"

AsyncPostBackTimeOut="600" >

</asp:ScriptManager>     

 

* The default value of the AsyncPostBackTimeOut property is 90 seconds.

Published Monday, April 16, 2007 11:22 PM by Avi Wortzel

Comments

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Tuesday, April 17, 2007 1:05 AM

It's importent to note that the original Timeout limit exists on the ScriptManager for very good reasons of scalability.

You should practiclly NEVER set the default timeout of an entire page/applciation.

If you have only one specific AJAX method (or a specific group of Microsoft AJAX methods) that require custom timeout you should seperate into a one service and set ONLY it's default code (by code).

for example let's say I have my "LongRunningWebMethod", "fastRunningWebMethod1", "fastRunningWebMethod2" & "fastRunningWebMethod3" in "myWebService".

First thing, I don't want to let my "fastRunningWebMethodX" to run more then the Microsoft AJAX default timeout.

So we'll refactor and move "LongRunningWebMethod" into a new webservice called "WebserviceForLongRunningWebMethods".

Then we can set ONLY this webservice timeout.

[JScript]

WebserviceForLongRunningWebMethods.set_timeout(600);

you can call this code on every page that uses "WebserviceForLongRunningWebMethods", or in every execution of the long running methods, or just in the proxy initlization code (assuming you're not generating it).

Justin-Josef Angel [MVP]

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Monday, August 13, 2007 5:30 PM

Do you know how to catch this error?

Mark Kamoski

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Monday, August 13, 2007 6:43 PM

Hi Mark,

If you want to handle this error in client side, you should register to end request event. In your handler check if an error occurred, and handle it (show an alert or put the error in a label).

I hope that this code sample will help you.

<script type="text/javascript">
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(requestEndHandler );

// This function will handle the end request event
function requestEndHandler(sender, args) {
   if( args.get_error() ){
      document.getElementById("errorMessageLabel").innerText = 
         args.get_error().description;
      args.set_errorHandled(true);
   }
}

</script>
...

<div id="errorMessageLabel"></div>

...

Avi wortzel

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Wednesday, November 14, 2007 11:22 PM

GFY

e

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Wednesday, December 19, 2007 12:50 AM

Great Fix

MMA

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Tuesday, February 19, 2008 5:12 PM

Or if you need to change one time in a particular page the timeout, you can add this line inside the page:

           AjaxControlToolkit.ToolkitScriptManager ajax = (AjaxControlToolkit.ToolkitScriptManager)this.Page.Master.FindControl("ToolkitScriptManager1");

if(ajax != null)

  ajax.AsyncPostBackTimeout = 600;

Dado

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Wednesday, April 23, 2008 10:36 AM

Thank you, this helped me very much!

ROman

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Wednesday, May 28, 2008 6:31 PM

I have created a site using the toolkit and I have one user that receives the PageRequestManagerTimeoutException frequently; but only one user. The site has been tested on IE6, IE7, FireFox 2x, Windows 2000, XP and Vista.  The only user having problems has XP with IE7.05730.11.  We have tested other XP machines with IE7 and do not receive the error.  Any ideas why this user is receiving this error?

Best regards,

Sean Gahan

Sean Gahan

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Wednesday, September 17, 2008 2:40 PM

Have them restart their computer.  That is what I usually suggest my clients.

Neal Shah

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Friday, October 10, 2008 1:52 PM

You should also find out what version jscript.dll each pc has; version 5.6.0.8820 is known to have problems when accessing sites that issue Ajax requests.

www.microsoft.com/.../ms06-023.mspx

Russ

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Wednesday, December 24, 2008 5:11 PM

thanks

123

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Tuesday, January 06, 2009 5:29 AM

I am using visual studio 2005, ASP.Net AJAX enabled website. When i want to save the data more than a time an exception occured

"sys.webforms.page request manager server error exception:An unknown error occured while processing the request on server. The status code returned from the server 403"

can any one help it out pls. urgent

Papanasam

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Wednesday, January 21, 2009 7:20 PM

Can we handle this error at server side?

Vijay

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Thursday, February 26, 2009 7:57 PM

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

Hai While running a aspx page I am getting this error while binding a dataset to a grid and the records are not get binded in the grid.

Can any one please me How to Overcome this problem

C.Sakthivel

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Tuesday, April 07, 2009 11:02 PM

AjaxControlToolkit.ToolkitScriptManager ajax = (AjaxControlToolkit.ToolkitScriptManager)this.Page.Master.FindControl("ToolkitScriptManager1");

if(ajax != null)

 ajax.AsyncPostBackTimeout = 600;

Dado

---------------------

I want to use this solution, but I don't know where place it in my code, I have to many pages, and each one have a scriptManager, so, how do I use this code?

Sebastian

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Monday, June 01, 2009 8:03 PM

Thanks Guy! Works Great

Faisal Salam

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Wednesday, June 10, 2009 6:24 PM

-------

I want to use this solution, but I don't know where place it in my code, I have to many pages, and each one have a scriptManager, so, how do I use this code?

--------

put the scriptmanager in the master page

porro

# re: Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error@ Monday, June 15, 2009 12:25 PM

Thank You For Solution Thanks A Lot.

Maruf Alam

# ??????SEO???????????????ICP???09037086??? &raquo; Sys.WebForms.PageRequestManagerTimeoutException &#8211; The server request timed out@ Saturday, March 13, 2010 5:08 AM

Pingback from  ??????SEO???????????????ICP???09037086??? &raquo; Sys.WebForms.PageRequestManagerTimeoutException &#8211; The server request timed out

??????SEO???????????????ICP???09037086??? » Sys.WebForms.PageRequestManagerTimeoutException – The server request timed out