ASP.NET Syntax ASP.NET Syntax for Web Controls
Displays static contents on the page and allows you to manipulate it programmatically.
Declarative Syntax
<asp:Literal
EnableTheming = "True | False"
EnableViewState = "True | False"
ID = "string"
Mode = "Transform | PassThrough | Encode"
OnDataBinding = "DataBinding event handler"
OnDisposed = "Disposed event handler"
OnInit = "Init event handler"
OnLoad = "Load event handler"
OnPreRender = "PreRender event handler"
OnUnload = "Unload event handler"
runat = "server"
SkinID = "string"
Text = "string"
Visible = "True | False"
/>
NOTE: The content of an <asp:Literal
> control can be defined within its opening tag. In this case, you can close the start tag with a trailing slash />
instead of using a separate end tag.
For information on the individual members of this class, see Literal in the class library.
The Literal control renders static text on a Web Forms page.
NOTE: Unlike the Label control, Literal does not let you apply styles to its content.
For more information, see the Literal Class documentation.
The below code snippet demonstrates how to use the Literal control to display static text.
<body>
<form runat="server">
<asp:Literal id="Literal1" Text = "Hello World!" runat="server" />
</form>
</body>
Literal Class