user3441151
user3441151

Reputation: 1910

asp.net c# wait operation time out

I have ASP.Net Project that was running perfectly. But i want that it automatically refresh and for that i added the one line of Code in Page Load

Code : Response.AppendHeader("Refresh", "30");

After added this code it run successfully 4 or 5 times but after that it gives an Error

The wait operation timed out

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

So what i do for that Exception.

I am using Visual Studio 2013 and SQL Server 2012 ASP.Net C#.

Upvotes: 0

Views: 1912

Answers (1)

Faisal Hameed
Faisal Hameed

Reputation: 104

I test the same line in page load event

Response.AppendHeader("Refresh", "5");

but no error occurred even after 10 minutes. error is generated by some other line of code you must search out or share the whole page.

second way:(you should try this)

  protected void Page_Load(object sender, EventArgs e)
  {
    if (!IsPostBack)
    {
        ScriptManager.RegisterStartupScript(this, GetType(), "refresh",      "window.setTimeout('window.location.reload(true);',5000);", true);

    }
}

Third way:(by using HTML META Tag)

Add the tag in head portion. This might not be recommended when you are using latest technologies like AJAX.

<meta http-equiv="refresh" content="30">
<meta http-equiv="refresh" content="30;url=Dashboard.aspx"> 

Upvotes: 1

Related Questions