See Also: Label Members
In this topic:
Use the System.Web.UI.WebControls.Label control to display text in a set location on the page. Unlike static text, you can customize the displayed text through the Label.Text property.
You can also use the System.Web.UI.WebControls.Literal and System.Web.UI.WebControls.PlaceHolder controls to display text on the Web Forms page. However, unlike the System.Web.UI.WebControls.Label control, these controls do not render any additional tags.
This control can be used to display user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview.
For information about how to configure this control so that it generates markup that conforms to accessibility standards, see Accessibility in Visual Studio 2010 and ASP.NET 4 and ASP.NET Controls and Accessibility.
Example
<asp:Label AccessKey="string" AssociatedControlID="string" BackColor="color name|#dddddd" BorderColor="color name|#dddddd" BorderStyle="