Home > DeveloperSection > Beginner > Label Control in ASP.Net

Label Control in ASP.Net


ASP.Net ASP.Net 
Ratings:
0 Comment(s)
 2932  View(s)
Rate this:

Label Control in ASP.Net

 The Label control is used to display text on a page.

Label Control in ASP.Net

<asp:Label ID="Label1" runat="server" Text="Hello"></asp:Label>

The id attribute is used to uniquely identify the <asp: label> control so you can refer to it in your ASP.NET code. The runat="server" attribute tells the server to process the control and generate HTML code to be sent to the client.

Label Control in ASP.Net

Properties

Property

Description

Text

The text to display in the label

ToolTip

The text that appears when the user rests the mouse pointer over a control

 

Label Control in ASP.Net

Here ‘Welcome’ is ToolTip, which user will if mouse pointer is over it. You can set this by using ToolTip property of Label Control.

Likewise we can also set its other properties like fore color, font, width, height etc.

<asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Italic="True"

Font-Size="Larger" ForeColor="#FF33CC" Text="Label"></asp:Label>

Label Control in ASP.Net


Don't want to miss updates? Please click the below button!

Follow MindStick