문제

나는 요청을하고있다 UpdatePanel 90 초 이상이 걸립니다. 이 타임 아웃 오류가 발생합니다.

Microsoft jscript 런타임 오류 : sys.webforms.pagerequestmanagertimeoutexception : 서버 요청이 시간이 초과되었습니다.

호출 시간이 끝나기 전에 시간을 늘리는 방법이 있는지 아는 사람이 있습니까?

도움이 되었습니까?

해결책

ScriptManager에 속성이 있습니다.

AsyncPostBackTimeout="300"

다른 팁

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;
}

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> 

Please follow the steps below:

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

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

This will solve your problem.

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.

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.

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.

    <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>
    
  2. You can put AsyncPostBackTimeout="6000" in .aspx page

    <asp:ToolkitScriptManager runat="server" AsyncPostBackTimeOut="6000">
    </asp:ToolkitScriptManager>
    
  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!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top