Note: This class is new in the .NET Framework version 2.0.
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)

Syntax
Visual Basic (Declaration)
<AttributeUsageAttribute(AttributeTargets.Class)> _
Public NotInheritable Class ViewStateModeByIdAttribute
Inherits Attribute
Dim instance As ViewStateModeByIdAttribute
[AttributeUsageAttribute(AttributeTargets.Class)]
public sealed class ViewStateModeByIdAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Class)]
public ref class ViewStateModeByIdAttribute sealed : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class) */
public final class ViewStateModeByIdAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Class)
public final class ViewStateModeByIdAttribute extends Attribute

Remarks
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.

.NET Framework Security

Inheritance Hierarchy

Thread Safety
Any public static (
Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

Version Information
.NET Framework
Supported in: 2.0

See Also