开发者

reset user password using only email

开发者 https://www.devze.com 2023-03-08 02:29 出处:网络
I am using asp.net built-in login components and I have disabled the security question and answer and

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 an开发者_运维百科swer.

Using asp.net 3.5

Thanks in advance


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);                
        }
0

精彩评论

暂无评论...
验证码 换一张
取 消