Using the Literal Web Control

The Literal Web control is one of the simplest Web controls. The HTML markup rendered by the Literal Web control is precisely the value of the Web control's Text property.

Let's create an ASP.NET Web page that has a Literal control. Start by creating a new ASP.NET Web page named LiteralControl.aspx. Once the new file has been created, verify that the Design tab is selected, and then drag and drop the Literal control from the Toolbox and onto the designer. Once you do this, you should see a screen similar to the screenshot shown in Figure 8.1.

Figure 8.1. A Literal Web control has been added to the designer.

Make sure that the Literal Web control you just added is selected, and then examine ...

Get SAMS Teach Yourself ASP.NET in 24 Hours now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.