【问题标题】:ReportViewer timeouts in spite of timeout settingsReportViewer 超时,尽管有超时设置
【发布时间】:2011-11-08 12:00:17
【问题描述】:

我有一个 ASP.NET 应用程序,它公开了一个 Microsoft ReportViewer(实际上是一个 MVC3 应用程序,其中一个 WebForm 托管了 ReportViewer)。运行大型报告时,会发生超时,导致请求停止,并显示空白页代替报告。然而,以下超时参数是以编程方式设置的:

Viewer.ServerReport.Timeout = Configuration.ReportViewerTimeout;
ScriptManager.AsyncPostBackTimeout = Configuration.ReportViewerAjaxTimeout;

各自的值是 -1 和 0,根据文档,它们被解释为没有超时。我也试过大值,没区别。

在等待报告加载大约一分钟后(“正在加载”消息框),我得到一个空白报告,并在我的 Firebug 控制台窗口中看到:

中止

Sys.WebForms.PageRequestManagerTimeoutException: 服务器请求超时。

[中断此错误] this._endPostBack(this._cr...anagerTimeoutError(), sender, null);

我也尝试将其添加到我的 web.config:

<httpRuntime maxRequestLength="1024000" executionTimeout="999999" /> 

在 IIS > 我的站点 > 高级设置 > 连接限制中,我将“连接超时(秒)”设置为 1200。所有这些都没有区别。

有人知道我可能会错过什么吗?

【问题讨论】:

    标签: asp.net iis timeout reportviewer


    【解决方案1】:

    原来答案是:其实什么都没有!

    碰巧的是,ScriptManager 的超时值不会保留在 ViewState 中(与 ReportViewer 的超时值不同),代码仅在 if (!PostBack) 块内设置一次。通过在每个请求(甚至回发)处设置 ScriptManager 的 AsyncPostBackTimeout 属性来修复。另一种方法是使用 Visual Studio WebForm 设计器将其设置为固定值。

    【讨论】:

      【解决方案2】:

      在脚本管理器中设置 AsyncPostBackTimeOut="" 值

         <asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeOut="56000" >
      </asp:ScriptManager>
      

      了解更多详情 http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.asyncpostbacktimeout.aspx

      【讨论】:

      • 很好,这防止了我的报告超时。
      【解决方案3】:

      添加上面提到的两个配置设置对我有用。

      在网站的 web.config 中设置 executionTimeout = "10800":

       <httpRuntime maxRequestLength="2147483647" executionTimeout = "10800"/>
      

      在 Site.Master 中设置 AsyncPostBackTimeout="56000":

       <asp:ToolkitScriptManager ID="smMaster" runat="server" AsyncPostBackTimeout="56000" />
      

      【讨论】:

      • 我需要做executionTimeout配置,非常感谢....
      【解决方案4】:

      我们遇到了完全相同的问题,除了将 ScriptManager AsyncPostBackTimeout 从默认的 90 秒更改为更大的值,例如 600(10 分钟),我们还必须将 Amazon ELB 负载均衡器设置从 1 分钟更改为 10分钟。这对我们有用。

      【讨论】:

        猜你喜欢
        • 2020-06-13
        • 1970-01-01
        • 1970-01-01
        • 2023-03-26
        • 1970-01-01
        • 1970-01-01
        • 2015-07-04
        • 2013-06-05
        • 1970-01-01
        相关资源
        最近更新 更多