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);
}
精彩评论