Assembly: System.Web (in System.Web.dll)
In order to change their password, users must be authenticated by the membership provider. To allow users who are not logged on to change their password, or to be authenticated by the membership provider with a different user account and then change the password for that account, the ChangePassword control can display a TextBox control to accept the user name.
You must set the ChangePassword control will be displayed to users who are not logged on; otherwise, the user will not be able to specify a user name.property to true if the
The following code example shows how to set the UserName control to users who are not logged on to the Web site.property to display the
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 property to true to enable the user 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.
Available since 2.0
ASP.NET Login Controls Overview
Customizing the Appearance of ASP.NET Login Controls
ASP.NET Web Server Controls Templates
How to: Display Different Information to Anonymous and Logged In Users
Web Site Administration Tool Security Tab
Securing Login Controls
Basic Security Practices for Web Applications