This documentation is archived and is not being maintained.

ChtmlTextWriter Constructor (TextWriter)

Initializes a new instance of the ChtmlTextWriter class that uses the DefaultTabString constant to indent lines.

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

public:
ChtmlTextWriter(
	TextWriter^ writer
)

Parameters

writer
Type: System.IO::TextWriter
The TextWriter that renders the markup content.

The ChtmlTextWriter class has two constructors, which is standard for all classes that derive directly or indirectly from the HtmlTextWriter class.

The ChtmlTextWriter constructor, which takes an instance of the TextWriter class as a parameter, calls the second constructor and passes it two parameter values:

  • The TextWriter.

  • The string value that is specified in the DefaultTabString field, which defines the tab spacing that is used by the XHTML text writer.

The following code example demonstrates how to create a class named ChtmlCustomPageAdapter and defines one method, CreateCustomChtmlTextWriter, which creates and returns an instance of the CustomChtmlTextWriter class. The CustomChtmlTextWriter then renders cHTML content for pages to devices with browsers that use cHTML markup.

This code example is part of a larger example provided for the ChtmlTextWriter class.

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

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: