System.Web.UI.HtmlTextWriter.WriteEncodedText Method

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

Syntax

public virtual void WriteEncodedText (string text)

Parameters

text
The text string to encode and write to the output stream.

Remarks

Use the HtmlTextWriter.WriteEncodedText(string) method when a string contains angle brackets (< or >) or an ampersand (&).

The HtmlTextWriter.WriteEncodedText(string) method uses the System.Web.HttpUtility.HtmlEncode(string, System.IO.TextWriter) method to perform the encoding and also converts Unicode character 00A0 to &nbsp;.

Requirements

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