Control.IsViewStateEnabled Property

Gets a value indicating whether view state is enabled for this control.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)

protected internal bool IsViewStateEnabled { get; }
/** @property */
protected boolean get_IsViewStateEnabled ()

protected internal function get IsViewStateEnabled () : boolean

Not applicable.

Property Value

true if view state is enabled for the control; otherwise, false.

View state can be enabled at the page, container, or control level. When view state is disabled at the page or container level, view state is disabled for all controls contained by the page or container. The IsViewStateEnabled property indicates whether view state is enabled by pages, containers, or controls.

It is possible for the EnableViewState property and the IsViewStateEnabled property to be different. For example, if the Page containing the control has view state disabled, the EnableViewState property can be true while the IsViewStateEnabled property is false.

Notes to Inheritors: Users will set the EnableViewState property to indicate whether they are using view state with your control. Use the IsViewStateEnabled property in your code to determine whether view state is enabled for your control and all containers.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0