Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

XhtmlControlAdapter Class

Note: This class is new in the .NET Framework version 2.0.

Provides a default control adapter for rendering mobile controls in XHTML markup.

Namespace: System.Web.UI.MobileControls.Adapters.XhtmlAdapters
Assembly: System.Web.Mobile (in system.web.mobile.dll)

public class XhtmlControlAdapter : ControlAdapter
public class XhtmlControlAdapter extends ControlAdapter
public class XhtmlControlAdapter extends ControlAdapter

This class provides a base mobile control adapter that renders a control and each of its children in XHTML markup for mobile devices. It also provides helper methods and common properties for derived XHTML mobile control adapters.

Control adapters are components that override certain Control class methods and events to allow browser-specific or markup-specific handling. Much of the adaptability in rendering behavior is encapsulated in the XhtmlTextWriter class. If you are considering whether to build your own control adapter, keep in mind that a single adapter can be used to override a number of browser class behaviors. Alternatively, by including the desired adaptability in a class derived from the XhtmlMobileTextWriter class, you might eliminate the need to use a control adapter.

An adapter for a specific control class applies to all controls that inherit from that class, unless more specialized adapters are present. For example, the XhtmlValidatorAdapter class is used to validate all mobile controls for devices that require or can display XHTML markup.

During processing, the .NET Framework intercepts calls to the methods of a control that are specific to the current target. If a control adapter is associated with the control, the .NET Framework calls the associated adapter methods.

Some properties of a control govern the way it displays across multiple secondary pages for a mobile device, which are collectively known as secondary UI. The SecondaryUIMode property can be used to define which page will be displayed. The ExitSecondaryUIMode method can be used to remove any secondary UI settings.

Notes to Inheritors When you inherit from the XhtmlControlAdapter class, name your adapter for a given control type and markup language in the pattern MarkupControlTypeAdapter (for example, XhtmlTextBoxAdapter). Adapters for a control that provides XHTML markup should be implemented in the System.Web.UI.MobileControls.Adapters.XhtmlAdapters namespace. Any specialized adapters should be defined for the specialized control under each of the device nodes in the configuration .browser files. A properly implemented control should not assume that an adapter is attached, or that the attached adapter implements a specific interface. Instead, it should check for these conditions. A number of conditional rendering methods allow for such conditions as secondary UI and for display devices that require line breaks after every block or after every inline control. Examples of these conditional methods are ConditionalSetPendingBreak and ConditionalEnterLayout. These methods are designed to work for a given device regardless of the control being rendered. It is unlikely you would need to override these methods when creating a new control adapter based on this class. At minimum, you would need to override the Render methods. Device filtering is required in order to use a specific adapter for a server control. For more information about device filtering, see Architectural Overview of Adaptive Control Behaviorad893895dbff and ASP.NET Device Filtering Overview.

System.Object
   System.Web.UI.MobileControls.Adapters.ControlAdapter
    System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlControlAdapter
       Derived Classes
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 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.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.