asp.net.ph

Skip Navigation Links

Literal Control Syntax

ASP.NET Syntax   ASP.NET Syntax for Web Controls


Displays static contents on the page and allows you to manipulate it programmatically.

Declarative Syntax

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.

Remarks

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.

Syntax Example

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>
See Also

Literal Class



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note