Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 2.0
System.Web.UI
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
.NET Framework Class Library
ViewStateModeByIdAttribute Class

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)

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

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

.NET Framework

Supported in: 2.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker