尽管超时设置,ReportViewer超时

Cla*_*fou 18 asp.net iis reportviewer timeout

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

Viewer.ServerReport.Timeout = Configuration.ReportViewerTimeout;
ScriptManager.AsyncPostBackTimeout = Configuration.ReportViewerAjaxTimeout;
Run Code Online (Sandbox Code Playgroud)

相应的值为-1和0,根据文档将其解释为无超时.我也尝试过大值,它没有任何区别.

大约一分钟左右等待报告加载("正在加载"消息框),我得到一个空白报告,我在Firebug控制台窗口中看到了这个:

中止

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

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

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

<httpRuntime maxRequestLength="1024000" executionTimeout="999999" /> 
Run Code Online (Sandbox Code Playgroud)

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

有谁知道我可能会缺少什么?

Mah*_*esh 16

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

   <asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeOut="56000" >
</asp:ScriptManager>
Run Code Online (Sandbox Code Playgroud)

有关详细信息,请访问 http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.asyncpostbacktimeout.aspx


Cla*_*fou 12

事实证明答案是:实际上没有什么遗漏!

实际上,ScriptManager的超时值不会在ViewState中持久存在(与ReportViewer的超时值不同),并且代码只在if (!PostBack)块内设置一次.通过在每个请求(甚至回发)中设置ScriptManager的AsyncPostBackTimeout属性来修复.另一种方法是使用Visual Studio WebForm设计器将其设置为固定值.


Job*_*col 6

添加上面提到的两个配置设置对我来说很有用.

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

 <httpRuntime maxRequestLength="2147483647" executionTimeout = "10800"/>
Run Code Online (Sandbox Code Playgroud)

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

 <asp:ToolkitScriptManager ID="smMaster" runat="server" AsyncPostBackTimeout="56000" />
Run Code Online (Sandbox Code Playgroud)