HtmlInputPassword Class
Allows programmatic access to the HTML <input type= password> element on the server.
Assembly: System.Web (in System.Web.dll)
[ValidationPropertyAttribute(L"Value")] [AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)] [AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)] public ref class HtmlInputPassword : public HtmlInputText, IPostBackDataHandler
<asp:HtmlInputPassword />
The HtmlInputPassword class is derived from the HtmlInputText class and is used to create a single-line text box that allows the user to enter a password. When using the HtmlInputPassword control, the Value property is posted to the server each time the form is submitted. The Value property for the HtmlInputPassword control is not persisted in view state.
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. Use the Value property to determine the value entered in the text box by the user. The HtmlInputPassword 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 HtmlInputPassword 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 back to the server, such as an HtmlButton or an HtmlInputSubmit control. |
For a list of initial property values for an instance of HtmlInputPassword, see the HtmlInputPassword 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: