ASP.NET Label Control.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
The ASP.NET Label control is used to render text on the webpage. The control is rendered in HTML as a Span element.
Working example.
Text within the ASP.NET Label control.
Creating the ASP.NET Label control.
From the above example.
<asp:Label ID="Label1" runat="server" BorderColor="Red" BorderStyle="Dotted" BorderWidth="3px"
Text="Text within the ASP.NET Label control."></asp:Label>
The above example will be rendered as HTML with the result below (source).
<span id="ctl00_ContentPlaceHolder1_Label1" style="display:inline-block;border-color:Red;border-width:3px;border-style:Dotted;">Text within the ASP.NET Label control.</span>
The border style property associated with the ASP.NET Label control is rendered as the style attribute for the HTML span element.
|