articles

Home / DeveloperSection / Articles / Label Control in ASP.Net

Label Control in ASP.Net

Pushpendra Singh 5766 10-Oct-2010

 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


Updated 04-Mar-2020

Leave Comment

Comments

Liked By