ASP.NET Label Control
Web Server Controls
Definition and Usage
The Label control is used to display text on the page. This text is programmable.
**Note:** This control allows you to apply styles to its content!
property
| property | Description |
|---|---|
| runat | Specifies that this control is a server control. Must be set to "server". |
| Text | The text displayed in the label. |
Web Control Standard Properties
AccessKey, Attributes, BackColor, BorderColor, BorderStyle, BorderWidth, CssClass, Enabled, Font, EnableTheming, ForeColor, Height, IsEnabled, SkinID, Style, TabIndex, ToolTip, Width
For a complete description, please visit Web Control Standard Properties。
Control Standard Properties
AppRelativeTemplateSourceDirectory, BindingContainer, ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer, Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID, Visible
For a complete description, please visit Web Control Standard Properties。
Example
Label
In this example, we declare a Label control, a TextBox control, and a Button control in the .aspx file. When the user clicks the button, the submit subroutine is executed. This subroutine copies the content of the TextBox control to the Label control.
Web Server Controls