Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

ViewStateMode Enumeration

Specifies whether view state will be enabled for a control.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)
public enum ViewStateMode
Member nameDescription
InheritInherit the value of ViewStateMode from the parent Control.
EnabledEnable view state for this control even if the parent control has view state disabled.
DisabledDisable view state for this control even if the parent control has view state enabled.

You can use the Control.ViewStateMode property to enable view state for an individual control even if it is disabled for the page.

To turn off view state for a page and turn it on for a specific control on the page, set the EnableViewState property of the page and the control to true, set the ViewStateMode property of the page to Disabled, and set the ViewStateMode property of the control to Enabled.

The ViewStateMode property of a page or a control has an effect only if the EnableViewState property is set to true. If the EnableViewState property is set to false, view state will be turned off even if the ViewStateMode property is set to Enabled.

.NET Framework

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.