Resets a user's password to a new, automatically generated password.
The new password for the membership user.
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())
Exception Type | Condition |
---|---|
NotSupportedException |
RequiresQuestionAndAnswer is set to true. orEnablePasswordReset is not set to true. |
NotSupportedException | the user is not a Visual Guard user and cannot be modified. |
VGMembershipUser Class | Novalys.VisualGuard.Security.Membership Namespace | VGMembershipUser.ResetPassword Overload List