Export (0) Print
Expand All

ChtmlTextWriter Class

Writes a series of cHTML-specific characters and text to the output stream of an ASP.NET server control. The ChtmlTextWriter class provides formatting capabilities that ASP.NET server controls use when rendering cHTML content to clients.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)

public class ChtmlTextWriter extends Html32TextWriter

Compact HTML, or cHTML, is a subset of HTML 2.0, HTML 3.2, and HTML 4.0, and is designed to render on devices with limited memory and CPU power, along with small display screens, limited formatting capabilities, and a limited number of input options (such as a cell phone touch pad). Therefore, cHTML does not support the following:

  • JPEG images.

  • Tables.

  • Image maps.

  • Multiple character fonts and styles.

  • Background colors and images.

  • Frames.

  • Style sheets.

The ChtmlTextWriter class derives from the Html32TextWriter class and much of its functionality is provided by the Html32TextWriter and the base class for all markup text writers, which is the HtmlTextWriter class.

The following code example demonstrates how to create a class named CustomChtmlTextWriter that is derived from the ChtmlTextWriter class. It creates two constructors and overrides the OnAttributeRender method to prevent the bgcolor style attribute from being written to the output stream of the ChtmlTextWriter object. It also creates a class named ChtmlCustomPageAdapter that defines one method, CreateCustomChtmlTextWriter, which creates and returns an instance of the CustomChtmlTextWriter class. The CustomChtmlTextWriter then renders cHTML content for a page to devices with browsers that use cHTML markup.

No code example is currently available or this language may not be supported.

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 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft