Export (0) Print
Expand All

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)

member IsViewStateEnabled : bool with get

Property Value

Type: System.Boolean
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

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

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft