System.Web.UI.ChtmlTextWriter.WriteEncodedText Method

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

Syntax

public override void WriteEncodedText (string text)

Parameters

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

Remarks

If the text parameter passed into the ChtmlTextWriter.WriteEncodedText(string) method is null or has a length of zero, then nothing is written.

Use the ChtmlTextWriter.WriteEncodedText(string) method when a string contains angle brackets (< or >) or an ampersand (&) and you want to ensure that they are rendered correctly on the requesting device. 

The ChtmlTextWriter.WriteEncodedText(string) method uses the base class's HtmlTextWriter.WriteEncodedText(string) method.

Requirements

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