Use the Mode property to specify how the contents of a Literal control should be rendered. This property is set using one of the LiteralMode enumeration values. The following table lists the possible values.
| Value | Description |
| PassThrough | The contents of the control are not modified. |
| Encode | The contents of the control are converted to an HTML-encoded string. |
| Transform | Unsupported markup-language elements are removed from the contents of the control. If the Literal control is rendered on a browser that supports HTML or XHTML, the control's contents are not modified. |
If you specify PassThrough, the entire contents of the Text property are passed to the device or browser without making any modifications. For example, if the Text property of a Literal control contains an <hr> tag, it is sent to all devices and browsers whether it is supported or not.
If you specify Encode, the contents for the Text property are converted into an HTML-encoded string before rendering. For example, if the Text property of a Literal control contains an <hr> tag, it is converted to <Hr> and sent to the device or browser.
If you specify Transform, the rendering behavior of the Text property depends on the type of markup being rendered. When the Literal control is rendered for a device or browser that supports HTML or XHTML, specifying Transform produces the same behavior as specifying PassThrough. All markup tags and elements for the Text property are rendered for the requesting browser.
When the Literal control is rendered for a markup language other than HTML or XHTML, such as WML or cHTML, you can use the Transform value to remove unsupported markup elements. In this case, any markup language elements of the Text property that are not supported in the targeted markup language are not rendered for the control. For example, if the Text property of a Literal control contains an <hr> tag, the tag is removed before the content is sent to a WML device. If an unsupported tag contains content, only the tag is removed and the content is sent to the device or browser. For example, if the Text property contains the content <XYZ>Test</XYZ>, the <XYZ> and </XYZ> tags are removed, and the text "Test" is sent to the device or browser.