Exemplo n.º 1
0
    protected void ChangeEmail_Click(object sender, EventArgs e)
    {
        try
        {
            PRMS Controller = new PRMS();
            if(Controller.ChangeEmail(CurrentUserID, EmailTextBox.Text))
            {
                EmailConfirmation.Text = "Your email has been successfully changed. Please login again with your new email.";
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Your email has been updated. Please login again with your new email.')", true);
                FormsAuthentication.SignOut();
                FormsAuthentication.RedirectToLoginPage();
            }
            else
            {
                EmailConfirmation.Text = "That email is registered under a different user.";
            }
        }
        catch (Exception)
        {

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(‘Error occurred with updating email. Please contact customer support for assistance if this issue persists.’)", true);

        }

    }