Редагувати

Поділитися через


Control.IsViewStateEnabled Property

Definition

Gets a value indicating whether view state is enabled for this control.

protected public:
 property bool IsViewStateEnabled { bool get(); };
protected internal bool IsViewStateEnabled { get; }
member this.IsViewStateEnabled : bool
Protected Friend ReadOnly Property IsViewStateEnabled As Boolean

Property Value

true if view state is enabled for the control; otherwise, false.

Remarks

View state can be enabled at the page, container, or control level. When view state is disabled at the page or container level, view state is disabled for all controls contained by the page or container. The IsViewStateEnabled property indicates whether view state is enabled by pages, containers, or controls.

It is possible for the EnableViewState property and the IsViewStateEnabled property to be different. For example, if the Page containing the control has view state disabled, the EnableViewState property can be true while the IsViewStateEnabled property is false.

Notes to Inheritors

Page developers will set the EnableViewState property and the ViewStateMode property to indicate whether they are using view state with your control. Use the IsViewStateEnabled property and the ViewStateMode property in your code to determine whether view state is enabled for your control and for all containers.

Applies to

See also