Wahtever
Wahtever

Reputation: 3678

reset user password using only email

I am using asp.net built-in login components and I have disabled the security question and answer and I am trying to allow the user to reset his password using only his email without the need for security question and answer.

Using asp.net 3.5

Thanks in advance

Upvotes: 0

Views: 591

Answers (1)

Aristos
Aristos

Reputation: 66641

You can use the ChangePassword class that is a ready to use form <asp:changepassword or you can use code to manual reset and change the password of your user.

        MembershipUser mu = Membership.GetUser(UserIdToChangePass);

        if (mu != null)
        {
            string sTempPassword = mu.ResetPassword();
            mu.ChangePassword(sTempPassword, txtNewPasswordFromUser.Text);                
        }

Upvotes: 1

Related Questions