ChangePassword.CurrentPassword Property

 

Gets the current password for the user.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

[<BrowsableAttribute(false)>]
[<ThemeableAttribute(false)>]
abstract CurrentPassword : string with get
[<BrowsableAttribute(false)>]
[<ThemeableAttribute(false)>]
override CurrentPassword : string with get

Property Value

Type: System.String

The current password entered by the user.

The CurrentPassword property contains the current password entered by the user.

System_CAPS_security Security Note

Transmitting passwords over HTTP is a potential security threat. HTTP transmissions can be viewed or compromised by malicious users. To improve security when using login controls, you should use HTTPS protocol with secure sockets layer (SSL) encryption to ensure that the user's password cannot be read during postback. For more information, see Securing Login Controls.

This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and ASP.NET Themes and Skins.

The following code example shows how to use an ASP.NET page that uses a ChangePassword control, and includes a handler for the ChangingPassword event named ChangingPassword. The code in the ChangingPassword handler compares the old password stored in the CurrentPassword property to the new password stored in NewPassword. If the two passwords are the same, changing the password fails.

The ChangePassword control sets the DisplayUserName property to true to enable users to enter their user name. This means that the user does not have to log on to view the page.

The code example assumes that the ASP.NET Web site has been configured to use ASP.NET membership and Forms authentication, and that a user has been created whose name and password are known to you. For more information, see How to: Implement Simple Forms Authentication.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: