UpdatePanel ASP.NET Timeout

I am making a request from UpdatePanel , which takes more than 90 seconds. I get this timeout error:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerTimeoutException: server request timeout.

Does anyone know if there is a way to increase the time before the call expires?

+47
ajax updatepanel
Oct 01 '08 at 18:18
source share
7 answers

ScriptManager has a property:

 AsyncPostBackTimeout="300" 
+83
Oct 01 '08 at 18:31
source share

In my case, the ScriptManager object was created in the main page file, which was then shared with the content page files. Thus, in order to change the ScriptManager.AsyncPostBackTimeout property on the content page, I had to access the object in the aspx.cs file of the content page:

 protected void Page_Load(object sender, EventArgs e) { . . . ScriptManager _scriptMan = ScriptManager.GetCurrent(this); _scriptMan.AsyncPostBackTimeout = 36000; } 
+35
Mar 16 '10 at 16:33
source share

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> 
+10
Oct 01 '08 at 18:27
source share

Please follow these steps:

Step 1: In web.config, set httpRuntime maxRequestLength="1024000" executionTimeout="999999"

Step 2. Add the following ScriptManager setting to your web page: AsyncPostBackTimeout ="360000"

This will solve your problem.

+4
May 21 '10 at 7:28 a.m.
source share

This can be configured by changing the ASP script timeout in IIS.

It is located in the properties of your website, virtual directory, configuration button, and then on the settings tab.

or set it by setting the Server.ScriptTimeout property.

+2
01 Oct '08 at 18:25
source share

Well, I suppose this will work if you just want the request to be dropped with a potential that it never completely fulfilled ...

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

Also, consider modifying the web service receiving the call for a faster transition. 90 seconds can also be endless on the Internet.

+1
01 Oct '08 at 18:31
source share

The problem you are facing is when your application is timed out in a SQL database query. It takes longer to return the result than the default. Therefore, you need to increase the ConnectionTimeout property.

You can do this in several ways:

  • The connection string has the ConnectionTimeout property. This property determines the maximum number of seconds during which your code will wait for the database connection to be opened. You can set the connection timeout in the connection string line in web.config .

     <connectionstrings> <add name="ConnectionString" connectionstring="Database=UKTST1;Server=BRESAWN;uid=" system.data.sqlclient="/><br mode=" hold=" /><br mode=" html="> <asp:ToolkitScriptManager runat=" server=" AsyncPostBackTimeOut=" 6000="><br mode="> </add> </connectionstrings> 
  • You can put AsyncPostBackTimeout="6000" in the .aspx page

     <asp:ToolkitScriptManager runat="server" AsyncPostBackTimeOut="6000"> </asp:ToolkitScriptManager> 
  • You can set the timeout in SqlCommand , where you call the stored procedure in the .cs file.

     command.CommandTimeout = 30*1000; 

Hope you have a solution!

0
May 30 '14 at 6:52
source share



All Articles