protected void btnForgotPassword_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.QueryString["guid"]) || !string.IsNullOrEmpty(Request.QueryString["username"])) { Guid guid = new Guid(Request.QueryString["guid"]); string username = Request.QueryString["username"]; bool IsValid = userClass.IsMatchUserDetails(username, guid); if (IsValid) { if (txtPassword.Text == txtConfirmNewPasword.Text) { Member member = Member.GetMemberFromLoginName(username); member.ChangePassword(userClass.HashPassword(txtConfirmNewPasword.Text)); member.Save(); FormsAuthentication.SetAuthCookie(username, false); Response.Redirect("/home.aspx"); } else { //Passwords are incorrect } } else { //User is not valid or password has expired } } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.QueryString["guid"]) || !string.IsNullOrEmpty(Request.QueryString["username"])) { Guid guid = new Guid(Request.QueryString["guid"]); string username = Request.QueryString["username"]; IsValid = userdetails_Class.IsMatchUserDetails(username, guid); if (IsValid) { FormsAuthentication.SetAuthCookie(username, false); Response.Redirect("/home.aspx"); } else { lblerror.Text = "Email Confirmation expired, Please contact AFDSL for further information."; } } }