Latest web development tutorials

ASP.NET Literal Text property

Literal controls Literal controls

Definition and Usage

Text property is used to set or return the Literal control's text.

If the text (as shown in the example below) in ASP.NET code will display the text before the HTML decoded. However, if programmatically, or set this property between the opening and closing tags of the control on the text, not HTML decoding for titles.

grammar

<asp:HyperLink Text="string" runat="server" />
属性 描述
string 字符串值,规定 literal 控件中的文本。


Examples

The following example sets the text to Literal controls:

<form runat="server">
<asp:Literal runat="server" Text="W3CSchool" />
</form>

The demonstration >>

Literal controls Literal controls