Label Control

A Label control is used to display text. The Label control’s Text property contains the text string to be displayed by the label. Note that Text is the only Label control property that is not inherited from the WebControl class. The Label control has no events or methods that are not derived from WebControl.

You have already seen the Label control used in the previous code examples in this chapter. The Text and Font properties of the Label control can be set programmatically, as shown in Example 5-1 and Example 5-2, or declaratively, as demonstrated in Example 5-3 and Example 5-4.

Get Programming ASP .NET 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.