System.Web.Security.MembershipUser.ChangePassword Method

Updates the password for the membership user in the membership data store.

Syntax

public virtual bool ChangePassword (string oldPassword, string newPassword)

Parameters

oldPassword
The current password for the membership user.
newPassword
The new password for the membership user.

Returns

true if the update was successful; otherwise, false.

Remarks

MembershipUser.ChangePassword(string, string) calls the MembershipProvider.ChangePassword(string, string, string) method of the membership provider referenced by the MembershipUser.ProviderName property to update the password for the membership user in the membership data store.

The membership provider may have restrictions on the size of the password. For size limitations, see the documentation for the membership provider.

Requirements

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0