EnableViewState Property

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}'", _
    pagesSection.EnableViewState)

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

.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft