Поделиться через


ReportViewer.KeepSessionAlive Property

Gets or sets a Boolean value that indicates whether to keep the user session from expiring as long as the Web page is displayed in the browser.

Namespace: Microsoft.Reporting.WebForms
Assembly: Microsoft.ReportViewer.WebForms (in microsoft.reportviewer.webforms.dll)

Syntax

'Declaration
<WebBrowsableAttribute(True)> _
<DefaultValueAttribute(True)> _
Public Property KeepSessionAlive As Boolean
'Usage
Dim instance As ReportViewer
Dim value As Boolean

value = instance.KeepSessionAlive

instance.KeepSessionAlive = value
[WebBrowsableAttribute(true)] 
[DefaultValueAttribute(true)] 
public bool KeepSessionAlive { get; set; }
[WebBrowsableAttribute(true)] 
[DefaultValueAttribute(true)] 
public:
property bool KeepSessionAlive {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_KeepSessionAlive ()

/** @property */
public void set_KeepSessionAlive (boolean value)
public function get KeepSessionAlive () : boolean

public function set KeepSessionAlive (value : boolean)

Property Value

true to keep the user session from expiring; otherwise, false. The default is true.

Remarks

Setting this property to true causes the ReportViewer control to keep the ASP.NET session from expiring if session is enabled in your ASP.NET application. Also, in remote processing mode, it causes the ReportViewer control to keep the report server session from expiring.

If you want to keep a session active for a user even when there is no activity on their part, set KeepSessionAlive to true.

In both local and remote processing modes, the ReportViewer control pings the Web server to keep the ASP.NET session active if ASP.NET session is enabled.

If you set KeepSessionAlive to false, the user session is kept active as long as the user interacts with the Web page. The user session will expire after a period of inactivity in the Web page. If the ASP.NET session expires, the message "ASP.NET session has expired or could not be found" is displayed when the user interacts with the ReportViewer again. If the report server session expires, the rsExecutionNotFound error is thrown when user interacts with the ReportViewer again.

See Also

Reference

ReportViewer Class
ReportViewer Members
Microsoft.Reporting.WebForms Namespace