HtmlInputText Class
Allows programmatic access to the HTML <input type= text> and <input type= password> elements on the server.
Assembly: System.Web (in System.Web.dll)
[ValidationPropertyAttribute(L"Value")] [AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)] [AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)] public ref class HtmlInputText : public HtmlInputControl, IPostBackDataHandler
<asp:HtmlInputText />
Use the HtmlInputText control to create a single-line text box that allows the user to enter text or a password. The MaxLength property specifies the maximum number of characters that can be entered in the text box. The 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 Value property. The HtmlInputText control provides a ServerChange event that is raised when the 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 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 HtmlButton control, to send the value of the control back to the server. |
To create a multi-line text box, use the HtmlTextArea control.
For a list of initial property values for an instance of HtmlInputText, see the HtmlInputText constructor.
| Topic | Location |
|---|---|
| How to: Add HTML Server Controls to a Web Page Using ASP.NET Syntax | Building ASP .NET Web Applications |
| How to: Set HTML Server Control Properties Programmatically | Building ASP .NET Web Applications |
| How to: Add HTML Server Controls to a Web Page Using ASP.NET Syntax | Building ASP .NET Web Applications |
| How to: Set HTML Server Control Properties Programmatically | Building ASP .NET Web Applications |
- AspNetHostingPermission
for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
System.Web.UI::Control
System.Web.UI.HtmlControls::HtmlControl
System.Web.UI.HtmlControls::HtmlInputControl
System.Web.UI.HtmlControls::HtmlInputText
System.Web.UI.HtmlControls::HtmlInputPassword
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: