0

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#.

1 Answer 1

1

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"> 
Sign up to request clarification or add additional context in comments.

1 Comment

In the above method, what is the best way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.