ReportViewer.KeepSessionAlive 属性

获取或设置一个 Boolean 值,该值指示当网页显示在浏览器中时是否阻止用户会话过期。

命名空间:  Microsoft.Reporting.WebForms
程序集:  Microsoft.ReportViewer.WebForms(在 Microsoft.ReportViewer.WebForms.dll 中)

语法

声明
<WebBrowsableAttribute(True)> _
Public Property KeepSessionAlive As Boolean
[WebBrowsableAttribute(true)]
public bool KeepSessionAlive { get; set; }
[WebBrowsableAttribute(true)]
public:
property bool KeepSessionAlive {
    bool get ();
    void set (bool value);
}
[<WebBrowsableAttribute(true)>]
member KeepSessionAlive : bool with get, set
function get KeepSessionAlive () : boolean
function set KeepSessionAlive (value : boolean)

属性值

类型:Boolean
如果阻止用户会话过期,则为 true;否则为 false。默认值为 true。

备注

将此属性设置为 true 会使**“ReportViewer”控件阻止 ASP.NET 会话过期(如果在 ASP.NET 应用程序中启用了会话)。另外,在远程处理模式下,它会使“ReportViewer”**控件阻止报表服务器会话过期。

如果希望即使在用户一方没有活动时也为用户保留活动会话,请将 KeepSessionAlive 设置为 true。

在本地和远程处理模式下,**“ReportViewer”**控件都会对 Web 服务器执行 ping 操作,以便在启用 ASP.NET 会话的情况下使 ASP.NET 会话处于活动状态。

如果将 KeepSessionAlive 设置为 false,则只要用户与网页交互,用户会话就一直处于活动状态。用户会话将在网页非活动状态持续一段时间后过期。如果 ASP.NET 会话过期,在用户再次与**“ReportViewer”交互时,将显示“ASP.NET 会话已过期或者找不到”消息。如果报表服务器会话过期,在用户再次与“ReportViewer”**控件交互时,将引发 rsExecutionNotFound 错误。

请参阅

参考

ReportViewer 类

Microsoft.Reporting.WebForms 命名空间