protected void btn_reset_password_Click(object sender, EventArgs e) { try { lbl_error.Text = ""; string error; Credentials credential = new Credentials(); credential.UserName = txt_user_name.Text; credential.Password = FormsAuthentication.HashPasswordForStoringInConfigFile(txt_confirm_new_password.Text, "SHA1");//LoginUtilities.PasswordHash(txt_user_name.Text + txt_confirm_new_password.Text); bool returnvalue = LoginUtilities.ResetPassword(credential, out error); lbl_error.Text = error; if (error == "") { string popupScript = ""; popupScript = "<script language='javascript'>showsuccessToast('Password has been updated successfully');</script>"; Page.ClientScript.RegisterStartupScript(typeof(Page), "popupScript", popupScript); Response.Redirect("~/Login.aspx"); } } catch (Exception) { throw; } }