Export (0) Print
Expand All

PagesSection.EnableViewState Property

Gets or sets a value indicating whether view state is enabled or disabled.

Namespace:  System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

<ConfigurationPropertyAttribute("enableViewState", DefaultValue := True)> _
Public Property EnableViewState As Boolean

Property Value

Type: System.Boolean
true if view state is enabled; false if view state is disabled. The default is true.

The following code example shows how to use the EnableViewState property.

' Get the current EnableViewState property value.
Console.WriteLine( _
    "Current EnableViewState value: '{0}'", _

' Set the EnableViewState property to false.
pagesSection.EnableViewState = False

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
© 2015 Microsoft