Standard Controls[17]->Literal

A Literal control is used to display text. You cannot apply a style to a literal control. This control will pass the content directly to the client browser, unless you use the Mode property to encode the content.

Simple Literal control

The following example demonstrates how to use the Literal control to display static text.

C# Literal1.aspx
Run Sample View Source

Encode Literal control

By setting the Mode property to Encode, the Literal control will encode the content of the Text property.

C# Literal2.aspx
Run Sample View Source

posted on 2007-05-14 09:31  改变热爱  阅读(117)  评论(0)    收藏  举报

导航