Page.CreateHtmlTextWriter Method (TextWriter)

 

Creates an HtmlTextWriter object to render the page's content.

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

abstract CreateHtmlTextWriter : 
        tw:TextWriter -> HtmlTextWriter
override CreateHtmlTextWriter : 
        tw:TextWriter -> HtmlTextWriter

Parameters

tw
Type: System.IO.TextWriter

The TextWriter used to create the HtmlTextWriter.

The CreateHtmlTextWriter method creates a TextWriter through the Browser property of the Request object associated with the page request. You can add a reference to an HtmlTextWriter in the browserCaps configuration section. Override the CreateHtmlTextWriter method to perform custom lookup.

The following code example uses the CreateHtmlTextWriter method to create an instance of a custom HtmlTextWriter object named MyHtmlTextWriter. The CreateHtmlTextWriter method is overridden in the MyPage class, which is derived from Page, so that MyHtmlTextWriter renders ASP.NET server controls when the page is requested. Note that this example will prevent adapter TextWriter behavior.

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

.NET Framework
Available since 1.1
Return to top
Show: