Author: mychucky | Posted on: 11/9/2010 2:35:31 PM | Views : 260

I'm writing a code for reseting a user's password. Below is my reset method:
protected void btnReset_Click(object sender, EventArgs e) { // Toggle the user's approved status string userName = Request.QueryString["user"]; //this is a class from the App_Code folder RandomStringGenerators rndPassword = new RandomStringGenerators(); string strPassword = Convert.ToString(rndPassword.NextString(7)); MembershipUser mu = Membership.Providers["SqlMembershipProviderResetPass"].GetUser(userName, true); //Response.Write("Password: " + strPassword); if (mu.ChangePassword(mu.ResetPassword(), strPassword)) { //lblMessage.Text = "Sucessfully reset " + userName + "'s password to " + strPassword; btnReset.Enabled = false; lblMessage.Text = "Sucessfully reset " ...

Go to the complete details ...