Skip Navigation LinksASP.Net 2.0 Training : ASP.Net Literal
Banner for ASP.Net 2.0 training classes in Visual Basic 2005 

Skip Navigation Links
Visit my other site:

certification training

Free Flash tutorials and training

Free Dreamweaver Video Tutorials

Free PHP Training

Visual Basic Windows Training

If you like this site please link to it

Literal Control

  • The Literal control is used to display text on a page. The text is programmable.
  • This control does not let you apply styles to its content!




A unique id for the control


Specifies that the control is a server control.  Must be set to "server"


Specifies the text to display

  • Open Visual Studio
  • Add a new webform
  • Name it literal.aspx
  • Click the Add button
  • Select the Design View
  • Add a label control and name it myLabel
  • Add a literal control to the webform and name it myLiteral
  • Erase the text in both controls

  • Double-click the form and add this code:

myLabel.text=”Label Example”

myLiteral.text=”Literal Example”

right click and view in Browser

now right click the browser and view source

Notice the Label is displayed in a <span> tag

But the literal is just displayed

A literal control displays ONLY the value in the text property

      ASP.Net 2.0 tutorials & training