Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

ViewStateModeByIdAttribute Class

Defines the metadata attribute that ASP.NET server controls use to specify whether they participate in loading view-state information by ID. This class cannot be inherited.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
[AttributeUsageAttribute(AttributeTargets.Class)] 
public sealed class ViewStateModeByIdAttribute : Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class) */ 
public final class ViewStateModeByIdAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Class) 
public final class ViewStateModeByIdAttribute extends Attribute
Not applicable.

The ViewStateModeByIdAttribute class is used to specify a control that requires view-state loading by ID. The default view-state loading behavior is for ASP.NET to load the view-state information for a control by its index in the control tree of the page. There is a performance cost for loading view-state information by ID because the page control tree must be searched for the control specifically before loading its view-state information.

If the ViewStateModeByIdAttribute class is used as a metadata attribute of a custom control class,

the LoadViewStateByID property of the control returns true. If the ViewStateModeByIdAttribute class is not used, the LoadViewStateByID property of the control returns its default value of false, which means that the control does not load its view-state information by ID.

For more information about using attributes, see Extending Metadata Using Attributes.

The ViewStateModeByIdAttribute class does not apply to saving the view-state information for a control.

The ViewStateModeByIdAttribute class metadata attribute is valid only on class declarations.

System.Object
   System.Attribute
    System.Web.UI.ViewStateModeByIdAttribute
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.