Assembly: System.Web (in system.web.dll)
The WebControl class is the base class from which Web controls inherit. It defines many properties common to all Web controls. For more information, see WebControl.
A WebControlAdapter object is a component that substitutes certain WebControl class or inherited methods and events in its execution life cycle to allow browser- or markup-specific handling. The .NET Framework maps a single control adapter to a derived WebControl object for each client request.
An adapter modifies a control behavior for a specific browser or class of browsers or acts as an arbitrary filter on some capability. Much of the adaptability in rendering behavior can be encapsulated in the specialized classes that derive from the HtmlTextWriter class. Therefore, it is likely that a single adapter can be used for a number of browser class behaviors or that inclusion of the adaptability in the HtmlTextWriter classes might make the use of a control adapter unnecessary.
Controls themselves do not necessarily require an adapter. If controls are extended through composition, generally the adapters for the child controls are sufficient.
Each control has explicit mappings to adapters through the .browser definition files. Thus, any access to the Adapter property of WebControl uses the HttpBrowserCapabilities object extracted from the .browser definition files to perform the lookup for the mapping of the adapter to control.
During processing, the .NET Framework intercepts calls to the overridable methods of a control that could be target-specific. If a control adapter is attached, the .NET Framework calls the associated adapter methods. For more information, see ControlAdapter.
The rendering for a WebControl typically consists of a beginning and ending tag, and some inner markup between the beginning and ending tags. The tags are defined when the WebControl is created. For more information, see WebControl.
The Render method generates all markup, by calling methods in the following order:
- AspNetHostingPermission for verifying at compilation time that the immediate caller into WebControlAdapter has this permission. Associated enumerations: LinkDemand, Minimal
- AspNetHostingPermission for verifying at load time that the class derived from WebControlAdapter has this permission. Associated enumerations: InheritanceDemand, Minimal
Windows 98, Windows 2000 SP4, Windows Millennium Edition, 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.