Last post Jun 23, 2017 05:29 AM by Jean Sun
Jun 22, 2017 02:55 PM|joegreen2005|LINK
I implemented user login using Identity v2.2.1. I'm not using any third party external logins. Somehow I want to allow users to reset forgotten password. What is the easiest way to do this.
Jun 22, 2017 03:33 PM|mgebhard|LINK
The default Visual Studio template (Individual Account) creates a password update action in the Manage controller. You can start there.
There are also tutorials on this site from the Learn link in the menu above. I'm not sure what easy means though...
Jun 23, 2017 05:29 AM|Jean Sun|LINK
Somehow I want to allow users to reset forgotten password. What is the easiest way to do this.
I think the easiest way is that:
1. Create two actions in your controller.
public ActionResult ResetPassword
public ActionResult ResetPassword(string email)
// code to check is there is a user has that email address // Code to generate a new password and change the user's password to the new password // code to send new password to that mail address
2. Create View Page with a form that allow user to input his email address.
@using (Html.BeginForm("ResetPassword", "Account", FormMethod.Post))
<label>Email Address :</label> <input type="text" name="email" id="email" />
<input type="submit" value="Reset PassWord" />