Beispiel #1
0
        protected void btnUpdatePassword_Click(object sender, EventArgs e)
        {
            string username = Session["UsernameRetrieve"].ToString();
            string password = txtNewPassword.Text;

            if (password == "")
            {
                smlNewPasswordHelp.InnerText = "Please enter a valid password";
                return;
            }
            else
            {
                smlNewPasswordHelp.InnerText = "";
            }

            UserService.UserService proxy = new UserService.UserService();
            bool updatePW = proxy.UpdatePassword(username, TwitterClassLibrary.Encryption.PasswordEncryption.EncryptPassword(password));

            if (!updatePW)
            {
                smlNewPasswordHelp.InnerText = "Password update failed, contact developers";
                return;
            }
            else
            {
                smlNewPasswordHelp.InnerText = "";
                Response.Redirect("Login.aspx");
            }
        }