System.Web.UI.WebControls.TextBox.Text Property

Gets or sets the text content of the System.Web.UI.WebControls.TextBox control.

Syntax

[System.ComponentModel.Editor("System.ComponentModel.Design.MultilineStringEditor,System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.Localizable(true)]
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.EncodedInnerDefaultProperty)]
[System.ComponentModel.DefaultValue("")]
[System.ComponentModel.Bindable(true, System.ComponentModel.BindingDirection.TwoWay)]
public virtual string Text { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the TextBox.Text property to specify or determine the text displayed in the System.Web.UI.WebControls.TextBox control. To limit the number of characters accepted by the control, set the TextBox.MaxLength property. If you want to prevent the text from being modified, set the TextBox.ReadOnly property.

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.

When the text box is rendered, the contents of this property are HTML-encoded. For example, if you set this property to "<b>Test</b>", the browser will display "<b>Test</b>", not "Test" in bold.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0