Summary

In this hour we looked at the two ASP.NET Web controls designed for displaying text output: the Literal Web control and the Label Web control. These two Web controls differ in the HTML markup they produce when being rendered.

When the Literal Web control is rendered, its Text property is returned as its HTML markup. No formatting is applied, and no extraneous HTML tags are added. The Literal Web control's rendered output is similar to that of the Response.Write()method, except that when using Response.Write(), the output is placed before any HTML content in the ASP.NET Web page's HTML portion. With the Literal Web control, you can place the Literal Web control anywhere within the HTML content, thereby having its output appear in a specific ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.