Ejemplo n.º 1
0
        protected void btnForgotPassword_Click(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                return;
            }

            string key = Membership.GenerateRecoveryKey(txtEmail.Text);

            if (!string.IsNullOrEmpty(key))
            {
                EmailMessagingService.SendPasswordRecoveryMailForUser(core.DAL.User.FetchByEmail(txtEmail.Text), key, null);
                mcMessageCenter.DisplaySuccessMessage(LoginPageStrings.GetText(@"ForgotPasswordSent"));
                phForgotFields.Visible = false;
            }
            else
            {
                mcMessageCenter.DisplayErrorMessage(LoginPageStrings.GetText(@"ForgotPasswordFailed"));
                //phForgotFields.Visible = false;
            }
        }