ViewStateModeByIdAttribute Class
Assembly: System.Web (in system.web.dll)
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.
- AspNetHostingPermission for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.