WebSecurity.ChangePassword(String, String, String) Method

Definition

Changes the password for the specified user.

public static bool ChangePassword (string userName, string currentPassword, string newPassword);
static member ChangePassword : string * string * string -> bool
Public Shared Function ChangePassword (userName As String, currentPassword As String, newPassword As String) As Boolean

Parameters

userName
String

The user name.

currentPassword
String

The current password for the user.

newPassword
String

The new password.

Returns

true if the password is successfully changed; otherwise, false.

Exceptions

The Initialize(String, NameValueCollection) method was not called.-or-The InitializeDatabaseConnection method was not called.-or-The SimpleMembershipProvider membership provider is not registered in the configuration of your site. For more information, contact your site's system administrator.

Applies to