Export (0) Print
Expand All

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
)

Parameters

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

Return Value

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

ExceptionCondition
ArgumentException

newPassword is null or empty.

InvalidOperationException

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.
Show:
© 2014 Microsoft