获取或设置一个 Boolean 值,该值指示是否在**“ReportViewer”**运行期间阻止报表服务器会话过期。
命名空间: Microsoft.Reporting.WinForms
程序集: Microsoft.ReportViewer.WinForms(在 Microsoft.ReportViewer.WinForms.dll 中)
语法
声明
Public Property KeepSessionAlive As Boolean
Get
Set
用法
Dim instance As ReportViewer
Dim value As Boolean
value = instance.KeepSessionAlive
instance.KeepSessionAlive = value
public bool KeepSessionAlive { get; set; }
public:
property bool KeepSessionAlive {
bool get ();
void set (bool value);
}
member KeepSessionAlive : bool with get, set
function get KeepSessionAlive () : boolean
function set KeepSessionAlive (value : boolean)
属性值
类型:System.Boolean
如果阻止报表服务器会话过期,则为 true;否则为 false。默认值为 true。
注释
在远程处理模式下,将此属性设置为 true 会使**“ReportViewer”控件阻止报表服务器会话过期。“ReportViewer”**控件会通过对报表服务器执行 ping 操作来阻止报表服务器会话过期。如果希望即使在用户一方没有活动时也使用户的报表服务器会话保持活动状态,请将 KeepSessionAlive 设置为 true。若要使会话在应用程序中超时和过期,请将 KeepSessionAlive 设置为 false。
在本地处理模式中,设置此属性没有任何作用。
如果 KeepSessionAlive 已设置为 false,且报表服务器会话已创建,则无法将此属性设置为 true。这样做将引发 InvalidOperationException。