asp.net.ph

Page.EnableViewState Property

System.Web.UI Namespace   Page Class


Sets or retrieves a value indicating whether the page maintains its view state, and the view state of any server controls it contains, when the current page request ends.

Syntax


Inline <%@ Page EnableViewState = true | false ... >
Script Page.EnableViewState [ = true | false ]

Property Value

This property accepts or returns only a boolean value: true if the page maintains its view state; otherwise false.

This property is read/write with a default value of true.

Remarks

A page's view state, and the view state of any controls it contains, is the accumulation of all its property values. In order to preserve these values across HTTP requests, ASP.NET uses an instance of the StateBag class to store the property values. The values are then passed as a variable to a hidden field when subsequent requests are processed. For more information about view state, see Web Forms State Management.

NOTE: This property can also be set declaratively using the @ Page directive.

Example

The following example shows the simplest way to retrieve and display the status of a page's view state.

<%= Page.EnableViewState %>

 Show me 

See Also

Page Members   Web Forms Page Processing Stages   Web Forms State Management   @ Page Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph