SimpleMembershipProvider.ResetPasswordWithToken Method

Resets a password after verifying that the specified password reset token is valid.

Namespace:  WebMatrix.WebData
Assembly:  WebMatrix.WebData (in WebMatrix.WebData.dll)

public override bool ResetPasswordWithToken(
	string token,
	string newPassword


Type: System.String
A password reset token.
Type: System.String
The new password.

Return Value

Type: System.Boolean
true if the password was changed; otherwise, false.


newPassword is null or empty.


The SimpleMembershipProvider class was not initialized using a call to the InitializeDatabaseConnection() method.

If a user forgets his or her password, you can generate a password reset token and send it to the user in an email message. The token is sent to the user as a link to a confirmation page on the website. When the user clicks the link, the token is verified by the confirmation page, and the user can enter a new password for the account. The user account password is changed only if the password reset token is valid.

  • Medium trust for the immediate caller. This member can be used by partially trusted code.