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 bool EnableViewState { get; set; }

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.
    "Current EnableViewState value: '{0}'",

// Set the EnableViewState property to false.
pagesSection.EnableViewState = false;

.NET Framework
Available since 2.0
Return to top