Пример #1
0
        protected void btnSendPasswordReset_Click(object sender, EventArgs e)
        {
            if (Data.Rows.Count > 0)
            {
                PasswordResetCode result = ResetPassword.SendResetEmail(Data.Rows[0]["Email"].ToString());
                switch (result)
                {
                case PasswordResetCode.Success:     //Success
                    TopMessage.SuccessMessage = "A message was sent to the email address containing a link to reset the user's password.";
                    break;

                case PasswordResetCode.InvalidEmail:     //Invalid email
                    TopMessage.ErrorMessage = "Invalid email address.";
                    break;

                case PasswordResetCode.GuidUpdateFailure:     //Failed updating GUID
                    TopMessage.ErrorMessage = "Invalid user information.";
                    break;

                case PasswordResetCode.CriticalError:     //Critical error
                default:
                    TopMessage.ErrorMessage = "It looks like there was an error sending the password reset email. Please try again.";
                    break;
                }
            }
            else
            {
                TopMessage.ErrorMessage = "Unable to verify the user's email address. Please try again. (EUE102)";
            }
        }