ASP.NET LabelControl
Web Server Control
Definition and Usage
The Label control is used to display text on a page. The text is programmable.
Note:This control allows you to apply styles to the content!
Properties
| Property | Description |
|---|---|
| runat | Specifies that the 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 full description, please visitWeb Control Standard Properties。
Control Standard Properties
AppRelativeTemplateSourceDirectory, BindingContainer,
ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer,
Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID,
Visible
For a full description, please visitControl Standard Properties。
Example
Label
In this example, we declare a Label control, a TextBox control, and a Button control in a .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 Control Other Extensions