Visual Guard Class Library Documentation

VGMembershipUser.ResetPassword Method ()

Resets a user's password to a new, automatically generated password.

public string ResetPassword();

Return Value

The new password for the membership user.

Remarks

If the property "Enable Password Reset" of the repository is not set to true a VGMembershipPasswordException will be thrown.Visual Guard is case sensitive when it checks the password answer. We strongly recommend to store the password answer as a lowered string and to provide a lowered value of the password answer when you want to reset the password by using the password question and answer.

user.ChangePasswordQuestionAndAnswer(myPassword.Text, newPasswordQuestion.Text, newPasswordAnswer.Text.ToLowerInvariant())

user.ResetPassword(myPasswordAnswer.Text.ToLowerInvariant())

Exceptions

Exception Type Condition
NotSupportedException

RequiresQuestionAndAnswer is set to true.

or

EnablePasswordReset is not set to true.

NotSupportedException the user is not a Visual Guard user and cannot be modified.

See Also

VGMembershipUser Class | Novalys.VisualGuard.Security.Membership Namespace | VGMembershipUser.ResetPassword Overload List