System.Web 2.0.0.0 System.Object

Control adapters are components that override certain class methods and events in its execution lifecycle to allow browser or markup-specific handling. The .NET Framework maps a single derived control adapter to a object for each client request.

An adapter modifies a control for a specific browser or class of browsers or acts as an arbitrary filter on some capability. Typically the adapter is defined by the markup language that the browser uses (for example, XHTML or HTML 3.2). Much of the adaptability in rendering behavior can be encapsulated in the specialized classes that derive from the 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 classes could make the use of a control adapter unnecessary.

An adapter for a control class applies to all controls that inherit from that class, unless more specialized adapters are present. For example, an adapter for the class can be used for all Validator objects.

Adapters typically do not inherit directly from the class, but from one of the target-specific adapter base classes that provide additional functionality specific to the control type and target browser or the particular rendering required.

Controls themselves do not necessarily require an adapter. If controls are extended through composition, generally the child control adapters are sufficient.

Each control has explicit mappings to adapters through the .browser definition files. Thus, any access to the property uses the 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.

The adapter performs rendering for the control through the method. If overridden, potentially should not call the base class implementation because that performs a call back on the method. This might cause the rendering to occur twice, once by the adapter and once by the control.

The base method calls back on the method of the control. Thus, if you override , you should not call the base class implementation unless the rendering you implement is in addition to that provided by of the control.

You must ensure that the .NET Framework performs interception for adapters of the child controls. You can do this by calling the base method, which calls the method of the control, from your override.

The and methods are called by the control immediately before and after (respectively) the control calls the method. If pre- and post-rendering are the only browser-specific processing tasks required, using and might make it unnecessary to override . The default behavior of the and methods is to call the corresponding methods of the .

To maintain its own state information, a control adapter can override the , , , and methods. , , , and are called when the private control and view states are saved and loaded, respectively.

The , , , and base methods call back on the corresponding class methods. Thus, any of these methods that are overridden must call their base methods; otherwise, the event associated with the class method will not be raised.

Controls and adapters optionally implement the and interfaces. The .NET Framework determines whether an adapter exists and whether the adapter implements these interfaces. If it does, the adapter should override the , , and methods, as necessary. If the postback data is not recognized in the adapter, it must call back on the control to process it. Subsequent event handlers also must call back on the control.

Customizes rendering for the derived control to which the adapter is attached, to modify the default markup or behavior for specific browsers, and is the base class from which all control adapters inherit.

- Constructor

  The .NET Framework internally constructs this adapter when it creates the corresponding object.

  Initializes a new instance of the class.

  2.0.0.0
- Method
  2.0.0.0
  System.Void `` To be added.

  The method is called just before the method, and is used to perform target-specific preprocessing before the rendering of the control.

  Use the method in combination with the method to ensure opening and closing tag consistency.

  Called prior to the rendering of a control. In a derived adapter class, generates opening tags that are required by a specific target but not needed by HTML browsers.

- Property
  System.Web.HttpBrowserCapabilities To be added.

  A object determines the client browser capabilities from the object that is returned by the property. This enables the object to render browser-specific markup or otherwise modify the behavior of the .

  Gets a reference to the browser capabilities of the client making the current HTTP request.

  2.0.0.0
- Property
  System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
  System.ComponentModel.Browsable(false)
  System.Web.UI.Control To be added.

  When a derived control adapter is attached to a control, the .NET Framework calls certain adapter members instead of the control members.

  Gets a reference to the control to which this control adapter is attached.

  2.0.0.0
- Method
  2.0.0.0
  System.Void

  If there is a derived control adapter attached to a object and the method is overridden, the override is called instead of the method. Thus, can be used to create a target-specific child control set.

  For more information about combining controls to create a new control, see Composite Controls.

  Creates the target-specific child controls for a composite control.

- Method
  2.0.0.0
  System.Void `` To be added.

  The method is called just after the method, and is used to perform target-specific postprocessing after the rendering of the control.

  Use the method in combination with the method to ensure opening and closing tag consistency.

  Called after the rendering of a control. In a derived adapter class, generates closing tags that are required by a specific target but not needed by HTML browsers.

- Method
  2.0.0.0
  System.Void ``

  Control state is the essential state information needed even if view state is disabled. When an adapter needs to maintain its own control state information, it can override the and methods.

  An adapter might need to maintain control state information when there are features that need to have state maintained across requests, independent from the state of the associated control. For example, a composite control consisting of a large textual display and a group of controls might render as a single view on desktop computer browsers. On other browsers, it might split its rendering—one view for the textual display and the other for the radio button group. The adapter would need to maintain its own target-specific information about the currently active view.

  The method is called immediately after the method, in the LoadState lifecycle stage. The adapter control state is separate and in addition to the control state of the control.

  Loads adapter control state information that was saved by during a previous request to the page where the control associated with this control adapter resides.

  An that contains the adapter's control state information as a .
- Method
  2.0.0.0
  System.Void ``

  When an adapter needs to maintain its own view state information, it can override the and methods.

  An adapter needs to maintain view state information when there is data that must be maintained across requests, independent from the view state of the associated control. For example, a grid control on desktop computer browsers might render as a single view of rows and columns of values. On other browsers, it might split its rendering into multiple separate views, such as a list of rows and details of a single row. The adapter would need to maintain the data for the views that are not currently active in view state.

  The method is called immediately before the method in the LoadState lifecycle stage. The adapter view state is separate and in addition to the view state of the control.

  Loads adapter view state information that was saved by during a previous request to the page where the control associated with this control adapter resides.

  An that contains the adapter view state information as a .
- Method
  2.0.0.0
  System.Void ``

  If there is an adapter attached to a object and the method is overridden, the override method is called instead of the method.

  Override to perform target-specific processing in the Initialize stage of the control lifecycle. Typically, these are functions that are performed when a control is created.

  Overrides the method for the associated control.

  An that contains the event data.
- Method
  2.0.0.0
  System.Void ``

  If there is an adapter attached to a object and the method is overridden, the override method is called instead of the method.

  Override the method to perform target-specific processing in the Load stage of the control lifecycle. Typically, these are functions that should be performed for each client request.

  Overrides the method for the associated control.

  An that contains the event data.
- Method
  2.0.0.0
  System.Void ``

  If there is an adapter attached to a object and the method is overridden, the override method is called instead of the method.

  Override the method to perform target-specific processing in the PreRender stage of the control lifecycle. Typically, these are functions that immediately precede rendering of the control output.

  Overrides the method for the associated control.

  An that contains the event data.
- Method
  2.0.0.0
  System.Void ``

  If there is an adapter attached to a object and the method is overridden, the override method is called instead of the method.

  Override the method to do target-specific processing in the Unload stage of the control lifecycle. Typically, these are cleanup functions that precede disposition of the control.

  Overrides the method for the associated control.

  An that contains the event data.
- Property
  System.ComponentModel.Browsable(false)
  System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
  System.Web.UI.Page To be added.

  The property provides access to the object where the control is situated.

  Gets a reference to the page where the control associated with this adapter resides.

  2.0.0.0
- Property
  System.ComponentModel.Browsable(false)
  System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
  System.Web.UI.Adapters.PageAdapter To be added.

  The property provides access to the object for the object where the object associated with the current object is situated.

  The property can be used to access other items at the page adapter level, such as common target-specific functions that could apply to several control types on the page.

  Gets a reference to the page adapter for the page where the associated control resides.

  2.0.0.0
- Method
  2.0.0.0
  System.Void `` To be added.

  Override the method to generate target-specific markup to send to the client browser. The method is called in place of the method if a object is attached to a object.

  Generates the target-specific markup for the control to which the control adapter is attached.

- Method
  2.0.0.0
  System.Void `` To be added.

  Override the method when it is necessary to generate target-specific markup for the child control set of a composite control, in addition to the markup for the individual child controls.

  Generates the target-specific markup for the child controls in a composite control to which the control adapter is attached.

- Method
  2.0.0.0
  System.Object

  Control state is the essential state information needed even if view state is disabled. When an adapter needs to maintain its own control state information, it can override the and methods.

  An adapter might need to maintain control state information when there are features that need to have state maintained across requests, independent from the state of the associated control. For example, a composite control consisting of a large textual display and a group of controls might render as a single view on desktop computer browsers. On other browsers, it might split its rendering—one view for the textual display and the other for the radio button group. The adapter would need to maintain its own target-specific information about the currently active view.

  The method is called immediately after the method in the SaveState lifecycle stage. The adapter control state is separate and in addition to the control state of the control.

  Saves control state information for the control adapter.

  An that contains the adapter's control state information as a .

- Method
  2.0.0.0
  System.Object

  When an adapter needs to maintain its own view state information, it can override the and methods.

  An adapter needs to maintain view state information when there is data that must be maintained across requests, independent from the associated view state of the control. For example, a grid control on desktop computer browsers might render as a single view of rows and columns of values. On other browsers, it might split its rendering into multiple separate views, such as a list of rows and details of a single row. The adapter would need to maintain the data for the views that are not currently active in view state.

  The method is called immediately before the method in the SaveState lifecycle stage. The adapter view state is separate and in addition to the view state of the control.

  Saves view state information for the control adapter.

  An that contains the adapter view state information as a .