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





The text to display in the label


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

Leave Comment