MembershipProvider.ChangePassword(String, String, String) Method

Definition

Processes a request to update the password for a membership user.

C#
public abstract bool ChangePassword(string username, string oldPassword, string newPassword);

Parameters

username
String

The user to update the password for.

oldPassword
String

The current password for the specified user.

newPassword
String

The new password for the specified user.

Returns

true if the password was updated successfully; otherwise, false.

Examples

For an example of a MembershipProvider implementation, see Implementing a Profile Provider.

Remarks

Takes, as input, a user name, a current password, and a new password, and updates the password in the data source if the supplied user name and current password are valid.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also