views:

6301

answers:

7

I'm making a request from an UpdatePanel that takes more then 90 seconds. I'm getting this timeout error.

"Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerTimeoutException: The server request timed out."

Does anyone know if there is a way to increase the amount of time before the the call times out?

+1  A: 

This might be configurable by changing the ASP script timeout in IIS.

It's located in the properties of your web site, virtual directory, configuration button, then on the options tab.

or set it by setting the Server.ScriptTimeout property.

Bravax
Server.ScriptTimeout is for the normal script or for the async ?
Barbaros Alp
Normal Script, not Async script.
Bravax
+2  A: 

This did the trick (basically just ignoring all timeouts):

<script type="text/javascript"> 
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function (sender, args) { 
            if (args.get_error() && args.get_error().name === 'Sys.WebForms.PageRequestManagerTimeoutException') { 
                            args.set_errorHandled(true); 
            } 
        }); 
    </script>
ctrlShiftBryan
+11  A: 

There is a property on the ScriptManager:

AsyncPostBackTimeout="300"
Telos
Thank you. This just came in helpoful for me.
David Stratton
+1  A: 

Well, I suppose that would work if you just want the request thrown away with the potential that it never completely executed...

Add an AsyncPostBackTimeOut property to the ScriptManager tag to change your default timeout from 90 seconds to something more reasonable for your application.

Further, look into changing the web service receiving the call to move faster. 90 seconds may as well be infinity in internet time.

Chris Lively
A: 

thanks, helped me

Flatron
+2  A: 

In my case the ScriptManager object was created in a Master Page file that was then shared with the Content Page files. So to change the ScriptManager.AsyncPostBackTimeout property in the Content Page, I had to access the object in the Content Page's aspx.cs file:

protected void Page_Load(object sender, EventArgs e)
{
     . . . 
     ScriptManager _scriptMan = ScriptManager.GetCurrent(this);
     _scriptMan.AsyncPostBackTimeout = 36000;
}
A: 

Hi folk,

Please follow below this steps,

Step1 : web.config-> 'httpRuntime maxRequestLength="1024000" executionTimeout="999999"'

Step2 : add in your web page script manager-> AsyncPostBackTimeout ="360000"

So this problem will solve.

rajalingam