Gets or sets the text content of the System.Web.UI.WebControls.Label control.
The text displayed in the label.
Use the Label.Text property to specify or determine the text content of the System.Web.UI.WebControls.Label control. This property is commonly used to programmatically customize the text that is displayed in the System.Web.UI.WebControls.Label control.
The Label.Text property can include HTML. If it does, the HTML will be passed unchanged to the browser, where is might be interpreted as markup and not as text. If you want the browser to display HTML markup as plain text, you can use the System.Web.HttpServerUtility.HtmlEncode(string) method, as shown in the example for the class overview. You can also use the System.Web.UI.WebControls.Literal control instead of the System.Web.UI.WebControls.Label control, and set the Literal.Mode property to LiteralMode.Encode.
Setting the Label.Text property will clear any other controls contained in the System.Web.UI.WebControls.Label control.
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.
The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see System.ComponentModel.LocalizableAttribute and ASP.NET Globalization and Localization.
This property is the default property that a System.Web.UI.WebControls.ControlParameter object binds to at run time. For more information, see System.Web.UI.ControlValuePropertyAttribute, System.Web.UI.WebControls.ControlParameter, and Using Parameters with Data Source Controls.