System.Web.UI.HtmlControls.HtmlInputText Class

Allows programmatic access to the HTML <input type= text> and <input type= password> elements on the server.

See Also: HtmlInputText Members

Syntax

[System.Web.UI.SupportsEventValidation]
[System.Web.UI.ValidationProperty("Value")]
[System.ComponentModel.DefaultEvent("ServerChange")]
public class HtmlInputText : HtmlInputControl, System.Web.UI.IPostBackDataHandler

Remarks

Use the System.Web.UI.HtmlControls.HtmlInputText control to create a single-line text box that allows the user to enter text or a password. The HtmlInputText.MaxLength property specifies the maximum number of characters that can be entered in the text box. The HtmlInputText.Size property allows you to specify the width of the text box. To determine the value entered by the user into text box, use the HtmlInputText.Value property. The System.Web.UI.HtmlControls.HtmlInputText control provides a HtmlInputText.ServerChange event that is raised when the HtmlInputText.Value property changes values between posts to the server. This allows you to create an event handler that performs a custom set of instructions each time the event is raised.

Note:

The System.Web.UI.HtmlControls.HtmlInputText control does not provide a built-in way to post back to the server. You must provide another control on the Web page that supports posting to the server, such as an System.Web.UI.HtmlControls.HtmlButton control, to send the value of the control back to the server.

To create a multi-line text box, use the System.Web.UI.HtmlControls.HtmlTextArea control.

For a list of initial property values for an instance of System.Web.UI.HtmlControls.HtmlInputText, see the HtmlInputText.#ctor constructor.

Requirements

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