XhtmlMobileTextWriter Class
Assembly: System.Web.Mobile (in system.web.mobile.dll)
XHTML is an XML-compliant markup that is based on HTML 4.1 and allows you to create Web sites suitable for multiple device types. It merges HTML's ease of use with XML's strict element guidelines to produce a markup language with a wide range of format and style options and reduced markup tag ambiguity. This class provides formatting capabilities that ASP.NET server controls use when rendering XHTML content to clients. The XhtmlMobileTextWriter renders markup that meets the standards of three different XHTML doc types: XHTML Basic, which supports limited style and format elements; XHTML Mobile Profile, which supports inline style sheets; and WML 2.0, which is based on XHTML 1.1 and supports cascading style sheets.
This class is used primarily by developers of custom mobile page and control adapters.
The XhtmlMobileTextWriter class can render all HTML elements, attributes, and style attributes, but, unlike the HtmlTextWriter class, does not allow title capitalization of these markup elements.
An XhtmlPageAdapter instantiates an XhtmlMobileTextWriter and depending on the capabilities of the target device, initializes a number of properties, such as SupportsNoWrapStyle, SuppressNewLine, and UseDivsForBreaks, that assist the text writer in rendering the page and its controls.
Your adapter can use a variety of methods to apply styles and control formatting:
-
EnterStyle and ExitStyle,
-
EnterLayout and ExitLayout, and
-
EnterFormat and ExitFormat.
Note: This class derives from the MobileTextWriter class, which in turn derives from the MultiPartWriter class, and much of its functionality is provided by these base classes.
You can use the members of this class, and any members it inherits from the MobileTextWriter class, to create custom text writers to use in a custom XHTML page or in class adapters. You can also create new derived classes that override the standard behavior of the XhtmlMobileTextWriter class.
Device filtering is required in order to use a specific adapter or text writer for a server control. For more information about device filtering, see Architectural Overview of Adaptive Rendering and Introduction to Device Filtering in ASP.NET.
- AspNetHostingPermission for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
System.MarshalByRefObject
System.IO.TextWriter
System.Web.UI.HtmlTextWriter
System.Web.UI.MobileControls.Adapters.MultiPartWriter
System.Web.UI.MobileControls.Adapters.MobileTextWriter
System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlMobileTextWriter
Windows 98, Windows Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Reference
XhtmlMobileTextWriter MembersSystem.Web.UI.MobileControls.Adapters.XhtmlAdapters Namespace
MobileTextWriter
MultiPartWriter
HtmlTextWriterAttribute
HtmlTextWriterStyle
Other Resources
ASP.NET and XHTML ComplianceArchitectural Overview of Adaptive Rendering
Introduction to Device Filtering in ASP.NET