System.Web.UI.HtmlTextWriter Members

The members of System.Web.UI.HtmlTextWriter are listed below.

See Also: Inherited members from System.IO.TextWriter

Public Constructors

Initializes a new instance of the System.Web.UI.HtmlTextWriter class that uses a default tab string.

Initializes a new instance of the System.Web.UI.HtmlTextWriter class with a specified tab string character.

Public Fields

const
DefaultTabStringstring.

Represents a single tab character.

const
DoubleQuoteCharchar.

Represents the quotation mark (") character.

const
EndTagLeftCharsstring.

Represents the left angle bracket and slash mark (</) of the closing tag of a markup element.

const
EqualsCharchar.

Represents the equal sign (=).

const
EqualsDoubleQuoteStringstring.

Represents an equal sign (=) and a double quotation mark (") together in a string (=").

const
SelfClosingCharsstring.

Represents a space and the self-closing slash mark (/) of a markup tag.

const
SelfClosingTagEndstring.

Represents the closing slash mark and right angle bracket (/>) of a self-closing markup element.

const
SemicolonCharchar.

Represents the semicolon (;).

const
SingleQuoteCharchar.

Represents an apostrophe (').

const
SlashCharchar.

Represents the slash mark (/).

const
SpaceCharchar.

Represents a space ( ) character.

const
StyleEqualsCharchar.

Represents the style equals (:) character used to set style attributes equal to values.

const
TagLeftCharchar.

Represents the opening angle bracket (<) of a markup tag.

const
TagRightCharchar.

Represents the closing angle bracket (>) of a markup tag.

Public Properties

[read-only]
override
EncodingSystem.Text.Encoding.

Gets the encoding that the System.Web.UI.HtmlTextWriter object uses to write content to the page.

Indentint.

Gets or sets the number of tab positions to indent the beginning of each line of markup.

InnerWriterSystem.IO.TextWriter.

Gets or sets the text writer that writes the inner content of the markup element.

override
NewLinestring.

Gets or sets the line terminator string used by the System.Web.UI.HtmlTextWriter object.

Protected Properties

TagKeyHtmlTextWriterTag.

Gets or sets the System.Web.UI.HtmlTextWriterTag value for the specified markup element.

TagNamestring.

Gets or sets the tag name of the markup element being rendered.

Public Methods

AddAttribute(string, string)

Adds the specified markup attribute and value to the opening tag of the element that the System.Web.UI.HtmlTextWriter object creates with a subsequent call to the erload:System.Web.UI.HtmlTextWriter.RenderBeginTag method.

AddAttribute(HtmlTextWriterAttribute, string)

Adds the markup attribute and the attribute value to the opening tag of the element that the System.Web.UI.HtmlTextWriter object creates with a subsequent call to the erload:System.Web.UI.HtmlTextWriter.RenderBeginTag method.

AddAttribute(string, string, bool)

Adds the specified markup attribute and value to the opening tag of the element that the System.Web.UI.HtmlTextWriter object creates with a subsequent call to the erload:System.Web.UI.HtmlTextWriter.RenderBeginTag method, with optional encoding.

AddAttribute(HtmlTextWriterAttribute, string, bool)

Adds the markup attribute and the attribute value to the opening tag of the element that the System.Web.UI.HtmlTextWriter object creates with a subsequent call to the erload:System.Web.UI.HtmlTextWriter.RenderBeginTag method, with optional encoding.

AddStyleAttribute(string, string)

Adds the specified markup style attribute and the attribute value to the opening markup tag created by a subsequent call to the erload:System.Web.UI.HtmlTextWriter.RenderBeginTag method.

AddStyleAttribute(HtmlTextWriterStyle, string)

Adds the markup style attribute associated with the specified System.Web.UI.HtmlTextWriterStyle value and the attribute value to the opening markup tag created by a subsequent call to the erload:System.Web.UI.HtmlTextWriter.RenderBeginTag method.

BeginRender()

Notifies an System.Web.UI.HtmlTextWriter object, or an object of a derived class, that a control is about to be rendered.

override
Close()

Closes the System.Web.UI.HtmlTextWriter object and releases any system resources associated with it.

EndRender()

Notifies an System.Web.UI.HtmlTextWriter object, or an object of a derived class, that a control has finished rendering. You can use this method to close any markup elements opened in the HtmlTextWriter.BeginRender method.

EnterStyle(System.Web.UI.WebControls.Style)

Writes the opening tag of a <span> element that contains attributes that implement the layout and character formatting of the specified style.

EnterStyle(System.Web.UI.WebControls.Style, HtmlTextWriterTag)

Writes the opening tag of a markup element that contains attributes that implement the layout and character formatting of the specified style.

ExitStyle(System.Web.UI.WebControls.Style)

Writes the closing tag of a <span> element to end the specified layout and character formatting.

ExitStyle(System.Web.UI.WebControls.Style, HtmlTextWriterTag)

Writes the closing tag of the specified markup element to end the specified layout and character formatting.

override
Flush()

Clears all buffers for the current System.Web.UI.HtmlTextWriter object and causes any buffered data to be written to the output stream.

IsValidFormAttribute(string) : bool

Checks an attribute to ensure that it can be rendered in the opening tag of a <form> markup element.

RenderBeginTag(string)

Writes the opening tag of the specified markup element to the output stream.

RenderBeginTag(HtmlTextWriterTag)

Writes the opening tag of the markup element associated with the specified System.Web.UI.HtmlTextWriterTag enumeration value to the output stream.

RenderEndTag()

Writes the end tag of a markup element to the output stream.

override
Write(bool)

Writes the text representation of a Boolean value to the output stream, along with any pending tab spacing.

override
Write(char)

Writes the text representation of a Unicode character to the output stream, along with any pending tab spacing.

override
Write(char[])

Writes the text representation of an array of Unicode characters to the output stream, along with any pending tab spacing.

override
Write(double)

Writes the text representation of a double-precision floating-point number to the output stream, along with any pending tab spacing.

override
Write(int)

Writes the text representation of a 32-byte signed integer to the output stream, along with any pending tab spacing.

override
Write(long)

Writes the text representation of a 64-byte signed integer to the output stream, along with any pending tab spacing.

override
Write(object)

Writes the text representation of an object to the output stream, along with any pending tab spacing.

override
Write(float)

Writes the text representation of a single-precision floating-point number to the output stream, along with any pending tab spacing.

override
Write(string)

Writes the specified string to the output stream, along with any pending tab spacing.

override
Write(string, object)

Writes a tab string and a formatted string to the output stream, using the same semantics as the string.Format(string, object) method, along with any pending tab spacing.

override
Write(string, params object[])

Writes a formatted string that contains the text representation of an object array to the output stream, along with any pending tab spacing. This method uses the same semantics as the string.Format(string, Object[]) method.

override
Write(char[], int, int)

Writes the text representation of a subarray of Unicode characters to the output stream, along with any pending tab spacing.

override
Write(string, object, object)

Writes a formatted string that contains the text representation of two objects to the output stream, along with any pending tab spacing. This method uses the same semantics as the string.Format(string, object, object) method.

WriteAttribute(string, string)

Writes the specified markup attribute and value to the output stream.

WriteAttribute(string, string, bool)

Writes the specified markup attribute and value to the output stream, and, if specified, writes the value encoded.

WriteBeginTag(string)

Writes any tab spacing and the opening tag of the specified markup element to the output stream.

WriteBreak()

Writes a <br /> markup element to the output stream.

WriteEncodedText(string)

Encodes the specified text for the requesting device, and then writes it to the output stream.

WriteEncodedUrl(string)

Encodes the specified URL, and then writes it to the output stream. The URL might include parameters.

WriteEncodedUrlParameter(string)

Encodes the specified URL parameter for the requesting device, and then writes it to the output stream.

WriteEndTag(string)

Writes any tab spacing and the closing tag of the specified markup element.

WriteFullBeginTag(string)

Writes any tab spacing and the opening tag of the specified markup element to the output stream.

override
WriteLine()

Writes a line terminator string to the output stream.

override
WriteLine(bool)

Writes any pending tab spacing and the text representation of a Boolean value, followed by a line terminator string, to the output stream.

override
WriteLine(char)

Writes any pending tab spacing and a Unicode character, followed by a line terminator string, to the output stream.

override
WriteLine(char[])

Writes any pending tab spacing and an array of Unicode characters, followed by a line terminator string, to the output stream.

override
WriteLine(double)

Writes any pending tab spacing and the text representation of a double-precision floating-point number, followed by a line terminator string, to the output stream.

override
WriteLine(int)

Writes any pending tab spacing and the text representation of a 32-byte signed integer, followed by a line terminator string, to the output stream.

override
WriteLine(long)

Writes any pending tab spacing and the text representation of a 64-byte signed integer, followed by a line terminator string, to the output stream.

override
WriteLine(object)

Writes any pending tab spacing and the text representation of an object, followed by a line terminator string, to the output stream.

override
WriteLine(float)

Writes any pending tab spacing and the text representation of a single-precision floating-point number, followed by a line terminator string, to the output stream.

override
WriteLine(string)

Writes any pending tab spacing and a text string, followed by a line terminator string, to the output stream.

override
WriteLine(uint)

Writes any pending tab spacing and the text representation of a 4-byte unsigned integer, followed by a line terminator string, to the output stream.

override
WriteLine(string, object)

Writes any pending tab spacing and a formatted string containing the text representation of an object, followed by a line terminator string, to the output stream.

override
WriteLine(string, params object[])

Writes any pending tab spacing and a formatted string that contains the text representation of an object array, followed by a line terminator string, to the output stream.

override
WriteLine(char[], int, int)

Writes any pending tab spacing and a subarray of Unicode characters, followed by a line terminator string, to the output stream.

override
WriteLine(string, object, object)

Writes any pending tab spacing and a formatted string that contains the text representation of two objects, followed by a line terminator string, to the output stream.

WriteLineNoTabs(string)

Writes a string, followed by a line terminator string, to the output stream. This method ignores any specified tab spacing.

WriteStyleAttribute(string, string)

Writes the specified style attribute to the output stream.

WriteStyleAttribute(string, string, bool)

Writes the specified style attribute and value to the output stream, and encodes the value, if specified.

Protected Methods

AddAttribute(string, string, HtmlTextWriterAttribute)

Adds the specified markup attribute and value, along with an System.Web.UI.HtmlTextWriterAttribute enumeration value, to the opening tag of the element that the System.Web.UI.HtmlTextWriter object creates with a subsequent call to the erload:System.Web.UI.HtmlTextWriter.RenderBeginTag method.

AddStyleAttribute(string, string, HtmlTextWriterStyle)

Adds the specified markup style attribute and the attribute value, along with an System.Web.UI.HtmlTextWriterStyle enumeration value, to the opening markup tag created by a subsequent call to the erload:System.Web.UI.HtmlTextWriter.RenderBeginTag method.

EncodeAttributeValue(string, bool) : string

Encodes the value of the specified markup attribute based on the requirements of the System.Web.HttpRequest object of the current context.

EncodeAttributeValue(HtmlTextWriterAttribute, string) : string

Encodes the value of the specified markup attribute based on the requirements of the System.Web.HttpRequest object of the current context.

EncodeUrl(string) : string

Performs minimal URL encoding by converting spaces in the specified URL to the string "%20".

FilterAttributes()

Removes all the markup and style attributes on all properties of the page or Web server control.

GetAttributeKey(string) : HtmlTextWriterAttribute

Obtains the corresponding System.Web.UI.HtmlTextWriterAttribute enumeration value for the specified attribute.

GetAttributeName(HtmlTextWriterAttribute) : string

Obtains the name of the markup attribute associated with the specified System.Web.UI.HtmlTextWriterAttribute value.

GetStyleKey(string) : HtmlTextWriterStyle

Obtains the System.Web.UI.HtmlTextWriterStyle enumeration value for the specified style.

GetStyleName(HtmlTextWriterStyle) : string

Obtains the markup style attribute name associated with the specified System.Web.UI.HtmlTextWriterStyle enumeration value.

GetTagKey(string) : HtmlTextWriterTag

Obtains the System.Web.UI.HtmlTextWriterTag enumeration value associated with the specified markup element.

GetTagName(HtmlTextWriterTag) : string

Obtains the markup element associated with the specified System.Web.UI.HtmlTextWriterTag enumeration value.

IsAttributeDefined(HtmlTextWriterAttribute) : bool

Determines whether the specified markup attribute and its value are rendered during the next call to the erload:System.Web.UI.HtmlTextWriter.RenderBeginTag method.

IsAttributeDefined(HtmlTextWriterAttribute, out string) : bool
Documentation for this section has not yet been entered.
IsStyleAttributeDefined(HtmlTextWriterStyle) : bool

Determines whether the specified markup style attribute is rendered during the next call to the erload:System.Web.UI.HtmlTextWriter.RenderBeginTag method.

IsStyleAttributeDefined(HtmlTextWriterStyle, out string) : bool
Documentation for this section has not yet been entered.
OnAttributeRender(string, string, HtmlTextWriterAttribute) : bool

Determines whether the specified markup attribute and its value can be rendered to the current markup element.

OnStyleAttributeRender(string, string, HtmlTextWriterStyle) : bool

Determines whether the specified markup style attribute and its value can be rendered to the current markup element.

OnTagRender(string, HtmlTextWriterTag) : bool

Determines whether the specified markup element will be rendered to the requesting page.

OutputTabs()

Writes a series of tab strings that represent the indentation level for a line of markup characters.

PopEndTag() : string

Removes the most recently saved markup element from the list of rendered elements.

PushEndTag(string)

Saves the specified markup element for later use when generating the end tag for a markup element.

static
RegisterAttribute(string, HtmlTextWriterAttribute)

Registers markup attributes, whether literals or dynamically generated, from the source file so that they can be properly rendered to the requesting client.

static
RegisterStyle(string, HtmlTextWriterStyle)

Registers markup style properties, whether literals or dynamically generated, from the source file so that they can be properly rendered to the requesting client.

static
RegisterTag(string, HtmlTextWriterTag)

Registers markup tags, whether literals or dynamically generated, from the source file so that they can be properly rendered to the requesting client.

RenderAfterContent() : string

Writes any text or spacing that occurs after the content and before the closing tag of the markup element to the markup output stream.

RenderAfterTag() : string

Writes any spacing or text that occurs after the closing tag for a markup element.

RenderBeforeContent() : string

Writes any text or spacing before the content and after the opening tag of a markup element.

RenderBeforeTag() : string

Writes any text or spacing that occurs before the opening tag of a markup element.

WriteUrlEncodedString(string, bool)

Writes the specified string, encoding it according to URL requirements.