简体   繁体   English

asp.net c#等待操作超时

[英]asp.net c# wait operation time out

I have ASP.Net Project that was running perfectly. 我有运行完美的ASP.Net项目。 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"); 代码: Response.AppendHeader("Refresh", "30");

After added this code it run successfully 4 or 5 times but after that it gives an Error 添加此代码后,它可以成功运行4或5次,但之后会出现错误

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#. 我正在使用Visual Studio 2013和SQL Server 2012 ASP.Net C#。

I test the same line in page load event 我在页面加载事件中测试了同一行

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

but no error occurred even after 10 minutes. 但即使10分钟后也没有发生错误。 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) 第三种方式:(通过使用HTML META标签)

Add the tag in head portion. 将标签添加到头部。 This might not be recommended when you are using latest technologies like AJAX. 当您使用AJAX等最新技术时,可能不建议这样做。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM