Forgot Password in ASP.NET
How can we create and implement Forgot Password module in ASP.NET MVC ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abhishek JaiswalPosted Jul 10, 2014, 9:12 AM
follow these steps:
1: first of all verify that the user who forgot his password is registered or valid user
(you can do that through security question or any unique field according to you)
2: create a new page for user validation
3: create a code for updation in database on button click event and store it to ur database
code as
protected void Button_Click(object sender, EventArgs e)
{
string strcon = ConfigurationManager.ConnectionStrings["connection"].ConnectionString;
SqlConnection con = new SqlConnection(strcon);
con.Open();
SqlCommand cmd = new SqlCommand("Update table ABC set N= @N where S= @S", con);
cmd.Parameters.Add("@N", SqlDbType.NVarChar).Value = TextBox1.Text;
cmd.Parameters.Add("@S", SqlDbType.Decimal).Value = TextBox2.Text;
int rowseffected = cmd.ExecuteNonQuery();
}
thats all! :)