Name
HtmlTextWriter
Synopsis
The ASP.NET framework uses this class when writing the client-side HTML for a
Web Forms page. It contains a wealth of methods for rendering the appropriate
content, and derives from the more generic System.IO.TextWriter
. Typically, you will not use this class
directly in your code, unless you are a control developer.
When deriving custom
controls from Control
or System.Web.UI.WebControls.WebControl
, you can override the Render()
or RenderContents()
method and
create the control’s output by using the supplied HtmlTextWriter
. Commonly used methods include Write()
, which can output text
or HTML tags, AddStyleAttribute()
, which
specifies a CSS style attribute for the next tag, and RenderBeginTag()
and RenderEndTag()
, which make it easy
to insert open and closing HTML tags while keeping the code readable. The HtmlTextWriter
also performs automatic
indentation of the HTML output.
Public Class HtmlTextWriter : Inherits System.IO.TextWriter ' Public Constructors Public Sub New(ByVal writer As System.IO.TextWriter) Public Sub New(ByVal writer As System.IO.TextWriter, ByVal tabString As String) ' Public Shared Fields public const DefaultTabString As String // = public const DoubleQuoteChar As Char // =&H000000022 public const EndTagLeftChars As String // =</ public const EqualsChar As Char // =&H00000003D public const EqualsDoubleQuoteString As String // ==” public const SelfClosingChars As String // = / public const SelfClosingTagEnd As String // = /> public ...
Get ASP.NET in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.