Example #1
0
        protected void ChangePassword_Click(object sender, EventArgs e)
        {
            if (txtNewPassword.Text == "" || txtOldPassword.Text == "")
            {
                Response.Write("<script>alert('Please give an input for both the new and old password');</script>");
            }
            else
            {
                if (currentUser.ChangePassword(txtOldPassword.Text, txtNewPassword.Text))
                {
                    Response.Write("<script>alert('Your password has been changed.');</script>");
                }
                else
                {
                    Response.Write("<script>alert('Unable to change password.  Wrong password given.');</script>");
                }

                txtOldPassword.Text = "";
                txtNewPassword.Text = "";
            }
        }