ASP.NET UpdatePanel Time Out

后端 未结 7 742
天命终不由人
天命终不由人 2020-12-08 02:21

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

Microsoft JScript runtime err

7条回答
  •  情书的邮戳
    2020-12-08 02:54

    The problem you are facing is when your application runs into a timeout on a SQL database query. It's taking more time than the default to return the output. So you need to increase the ConnectionTimeout property.

    You can do it in several ways:

    1. A connection string has a ConnectionTimeout property. It is a property that determines the maximum number of seconds your code will wait for a connection of the database to be opened. You can set connection timeout in connection string section in web.config.

      
          
          
      
      
    2. You can put AsyncPostBackTimeout="6000" in .aspx page

      
      
      
    3. You can set timeout in SqlCommand, where you are calling the stored procedure in .cs file.

      command.CommandTimeout = 30*1000;
      

    Hope you have a solution!

提交回复
热议问题