ASP.NET Text Property | .com
Learn not just technology, but also dreams!
ASP.NET Text Property
The Text property is used to get or set the text displayed in a control.
Syntax
object.Text = "text"
string text = object.Text
Example
The following example demonstrates how to use the Text property of a Label control:
<asp:Label ID="Label1" runat="server" Text="Hello World!" />
Explanation
In this example, the Label control displays the text "Hello World!" on the page.
Related Properties
- Text - Gets or sets the text content of the control.
- Visible - Determines whether the control is visible on the page.
- Enabled - Determines whether the control is enabled or disabled.
YouTip