/// <summary> /// This is the event handler for errors during user creation. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void cuwRegister_CreateUserError(object sender, CreateUserErrorEventArgs e) { this.pnlError.Visible = true; MembershipProvider provider = Membership.Provider; switch (e.CreateUserError.ToString()) { case "DuplicateUserName": this.litError.Text = "A user with that user name already exists. Please use a different user name"; break; case "DuplicateEmail": this.litError.Text = "A user with that email address already exists. Please use a different email address"; break; case "InvalidPassword": this.litError.Text = string.Format(this.cuwRegister.InvalidPasswordErrorMessage, provider.MinRequiredPasswordLength, provider.MinRequiredNonAlphanumericCharacters); break; default: this.litError.Text = string.Format("There was an error creating a user: {0}", e.CreateUserError.ToString()); break; } if (e.CreateUserError.ToString() == "DuplicateEmail") { this.pnlError.Visible = true; this.litError.Text = "A user with that email address already exists. Please use a different email address"; } }
protected void CreateUserWizard1_CreateUserError(object sender, CreateUserErrorEventArgs e) { Literal ltlMessage = (Literal)CreateUserWizardStep1.ContentTemplateContainer.FindControl("ltlMessage"); ltlMessage.Text = ltlMessage.Text = MessageFormatter.GetFormattedErrorMessage(GetErrorMessage(e.CreateUserError)); }
/// <summary> /// Handles the CreateUserError event of the CreateUserWizard1 control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="CreateUserErrorEventArgs"/> instance containing the event data.</param> protected void CreateUserWizard1_CreateUserError([NotNull] object sender, [NotNull] CreateUserErrorEventArgs e) { string createUserError = string.Empty; // find the type of error switch (e.CreateUserError) { case MembershipCreateStatus.DuplicateEmail: createUserError = this.GetText("ALREADY_REGISTERED"); break; case MembershipCreateStatus.DuplicateUserName: createUserError = this.GetText("ALREADY_REGISTERED"); break; case MembershipCreateStatus.InvalidEmail: createUserError = this.GetText("BAD_EMAIL"); break; case MembershipCreateStatus.InvalidPassword: createUserError = this.GetText("BAD_PASSWORD"); break; case MembershipCreateStatus.InvalidQuestion: createUserError = this.GetText("INVALID_QUESTION"); break; case MembershipCreateStatus.InvalidUserName: createUserError = this.GetText("INVALID_USERNAME"); break; case MembershipCreateStatus.InvalidAnswer: createUserError = this.GetText("INVALID_ANSWER"); break; case MembershipCreateStatus.InvalidProviderUserKey: createUserError = "Invalid provider user key."; break; case MembershipCreateStatus.DuplicateProviderUserKey: createUserError = "Duplicate provider user key."; break; case MembershipCreateStatus.ProviderError: createUserError = "Provider Error"; break; case MembershipCreateStatus.UserRejected: createUserError = "User creation failed: Reason is defined by the provider."; break; } this.PageContext.AddLoadMessage(createUserError, MessageTypes.Error); // Display the failure message in a client-side alert box // Page.ClientScript.RegisterStartupScript(Page.GetType(), "CreateUserError", String.Format("alert('{0}');", createUserError.Replace("'", "\'")), true); }
protected void CreateUserWizardControl_CreateUserError(object sender, CreateUserErrorEventArgs e) { InfoLabel.Visible = true; System.Text.StringBuilder mailLink = new System.Text.StringBuilder(this.GetMailLink()); // MembershipCreateStatus.InvalidAnswer not used. // MembershipCreateStatus.InvalidQuestion not used. switch (e.CreateUserError) { case MembershipCreateStatus.DuplicateUserName: InfoLabel.Text = "User name already exists. " + "Please enter a different user name."; break; case MembershipCreateStatus.DuplicateEmail: InfoLabel.Text = "A user name for that e-mail address already exists. " + "Please enter a different e-mail address."; break; case MembershipCreateStatus.InvalidPassword: InfoLabel.Text = "The password provided is invalid. " + "Please enter a valid password . " + "Acceptable passwords are at least 7 characters long and contain at least 1 non-alphanumeric character."; break; case MembershipCreateStatus.InvalidEmail: InfoLabel.Text = "The e-mail address provided is invalid. Please check the value and try again."; break; case MembershipCreateStatus.InvalidUserName: InfoLabel.Text = "The user name provided is invalid. " + "Please check the value and try again."; break; case MembershipCreateStatus.ProviderError: InfoLabel.Text = "The authentication provider returned an error. " + "Please verify your entry and try again. " + "If the problem persists, please contact the " + mailLink.ToString() + "."; break; case MembershipCreateStatus.UserRejected: InfoLabel.Text = "The user creation request has been canceled. " + "Please verify your entry and try again. " + "If the problem persists, please contact the " + mailLink.ToString() + "."; break; default: InfoLabel.Text = "An unknown error occurred. " + "Please verify your entry and try again. " + "If the problem persists, please contact the " + mailLink.ToString() + "."; break; } }
protected void CreateUserWizard_CreateUserError(object sender, CreateUserErrorEventArgs e) { try { } catch (Exception) { Response.Write("<script>window.alert('Campos Incompletos');</script>"); } }
/// <summary> /// Handles the CreateUserError event of the CreateUserWizard1 control. /// </summary> /// <param name="sender"> /// The source of the event. /// </param> /// <param name="e"> /// The <see cref="CreateUserErrorEventArgs"/> instance containing the event data. /// </param> protected void CreateUserWizard1_CreateUserError([NotNull] object sender, [NotNull] CreateUserErrorEventArgs e) { var createUserError = string.Empty; // find the type of error switch (e.CreateUserError) { case MembershipCreateStatus.DuplicateEmail: createUserError = this.GetText("ALREADY_REGISTERED"); break; case MembershipCreateStatus.DuplicateUserName: createUserError = this.GetText("ALREADY_REGISTERED"); break; case MembershipCreateStatus.InvalidEmail: createUserError = this.GetText("BAD_EMAIL"); break; case MembershipCreateStatus.InvalidPassword: createUserError = this.GetText("BAD_PASSWORD"); break; case MembershipCreateStatus.InvalidQuestion: createUserError = this.GetText("INVALID_QUESTION"); break; case MembershipCreateStatus.InvalidUserName: createUserError = this.GetText("INVALID_USERNAME"); break; case MembershipCreateStatus.InvalidAnswer: createUserError = this.GetText("INVALID_ANSWER"); break; case MembershipCreateStatus.InvalidProviderUserKey: createUserError = "Invalid provider user key."; break; case MembershipCreateStatus.DuplicateProviderUserKey: createUserError = "Duplicate provider user key."; break; case MembershipCreateStatus.ProviderError: createUserError = "Provider Error"; break; case MembershipCreateStatus.UserRejected: createUserError = "User creation failed: Reason is defined by the provider."; break; } this.PageContext.AddLoadMessage(createUserError, MessageTypes.danger); }
protected void cuwReview_CreateUserError(object sender, CreateUserErrorEventArgs e) { switch (e.CreateUserError) { case System.Web.Security.MembershipCreateStatus.DuplicateEmail: cuwReview.DuplicateEmailErrorMessage = "The email address you've specified is already in use.<br />If you've already registered with ClearCost Health please try logging in or using \"Forgot Password\""; break; case System.Web.Security.MembershipCreateStatus.DuplicateProviderUserKey: break; case System.Web.Security.MembershipCreateStatus.DuplicateUserName: //cuwReview.DuplicateUserNameErrorMessage = "<div style=\"text-align:left;color:red;\">Our records show you've already registered.<br />Please try logging in via the <a href=\"Sign_In.aspx\">Sign In</a> page.<br />If you've forgotten your password please click <a href=\"../../ResetPassword.aspx\">Forgot Password</a></div>"; break; case System.Web.Security.MembershipCreateStatus.InvalidAnswer: cuwReview.InvalidAnswerErrorMessage = "The answer you've provided to the Security Question is invalid.<br />Please check your answer and try again."; break; case System.Web.Security.MembershipCreateStatus.InvalidEmail: cuwReview.InvalidEmailErrorMessage = "The email address you've provided is invalid.<br />Please check the email address you supplied and try again."; break; case System.Web.Security.MembershipCreateStatus.InvalidPassword: cuwReview.InvalidPasswordErrorMessage = "The password you've provided is invalid.<br />Please choose a different password of at least {0} characters."; break; case System.Web.Security.MembershipCreateStatus.InvalidProviderUserKey: break; case System.Web.Security.MembershipCreateStatus.InvalidQuestion: break; case System.Web.Security.MembershipCreateStatus.InvalidUserName: cuwReview.InvalidPasswordErrorMessage = "The email address you entered was invalid.<br />Please check the email address you supplied and try again."; break; case System.Web.Security.MembershipCreateStatus.ProviderError: break; case System.Web.Security.MembershipCreateStatus.Success: break; case System.Web.Security.MembershipCreateStatus.UserRejected: break; default: break; } }
protected void CreateUserWizard1_CreateUserError(object sender, CreateUserErrorEventArgs e) { litErrorMessage.Text = GetErrorMessage(e.CreateUserError); if (e.CreateUserError == MembershipCreateStatus.DuplicateUserName) { litErrorMessage.Visible = false; lblUsernameError.Visible = true; } else { litErrorMessage.Visible = true; lblUsernameError.Visible = false; } }
protected void cuwReview_CreateUserError(object sender, CreateUserErrorEventArgs e) { switch (e.CreateUserError) { case System.Web.Security.MembershipCreateStatus.DuplicateEmail: cuwReview.DuplicateEmailErrorMessage = "The email address you've specified is already in use.<br />If you've already registered with ClearCost Health please try logging in or using \"Forgot Password\""; break; case System.Web.Security.MembershipCreateStatus.DuplicateProviderUserKey: break; case System.Web.Security.MembershipCreateStatus.DuplicateUserName: cuwReview.DuplicateUserNameErrorMessage = "Our records show you've already registered.<br />Please try logging in via the login page.<br />If you've forgotten your password please click \"Forgot Password\""; break; case System.Web.Security.MembershipCreateStatus.InvalidAnswer: cuwReview.InvalidAnswerErrorMessage = "The answer you've provided to the Security Question is invalid.<br />Please check your answer and try again."; break; case System.Web.Security.MembershipCreateStatus.InvalidEmail: cuwReview.InvalidEmailErrorMessage = "The email address you've provided is invalid.<br />Please check the email address you supplied and try again."; break; case System.Web.Security.MembershipCreateStatus.InvalidPassword: cuwReview.InvalidPasswordErrorMessage = "The password you've provided is invalid.<br />Please retype the password you supplied and try again."; break; case System.Web.Security.MembershipCreateStatus.InvalidProviderUserKey: break; case System.Web.Security.MembershipCreateStatus.InvalidQuestion: break; case System.Web.Security.MembershipCreateStatus.InvalidUserName: break; case System.Web.Security.MembershipCreateStatus.ProviderError: break; case System.Web.Security.MembershipCreateStatus.Success: break; case System.Web.Security.MembershipCreateStatus.UserRejected: break; default: break; } }
protected void CreateUser_CreateUserError(object sender, CreateUserErrorEventArgs e) { // Define the name and type of the client scripts on the page. String csErrorRowName = "errorRowScript"; Type cstype = this.GetType(); // Get a ClientScriptManager reference from the Page class. ClientScriptManager cs = Page.ClientScript; // Check to see if the startup script is already registered. if (!cs.IsStartupScriptRegistered(cstype, csErrorRowName)) { cs.RegisterStartupScript(cstype, csErrorRowName, "document.getElementById(\"errorRow\").style.display=\"block\";", true); } }
protected void RegistroDeUsuarioForm_CreateUserError(object sender, CreateUserErrorEventArgs e) { Literal txtError = (Literal)RegistroDeUsuarioForm.CreateUserStep.ContentTemplateContainer.FindControl("CreateUserErrorMessage"); switch (e.CreateUserError) { case MembershipCreateStatus.DuplicateUserName: txtError.Text = "<div class='form-group col-xs-12 col-lg-12'><div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button><span class='glyphicon glyphicon-warning-sign'></span> Username already exists. Please enter a different user name.</div></div>"; break; case MembershipCreateStatus.DuplicateEmail: txtError.Text = "<div class='form-group col-xs-12 col-lg-12'><div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button><span class='glyphicon glyphicon-warning-sign'></span> A username for that e-mail address already exists. Please enter a different e-mail address.</div></div>"; break; case MembershipCreateStatus.InvalidPassword: txtError.Text = "<div class='form-group col-xs-12 col-lg-12'><div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button><span class='glyphicon glyphicon-warning-sign'></span> The password provided is invalid. Please enter a valid password value.</div></div>"; break; case MembershipCreateStatus.InvalidEmail: txtError.Text = "<div class='form-group col-xs-12 col-lg-12'><div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button><span class='glyphicon glyphicon-warning-sign'></span> The e-mail address provided is invalid. Please check the value and try again.</div></div>"; break; case MembershipCreateStatus.InvalidAnswer: txtError.Text = "<div class='form-group col-xs-12 col-lg-12'><div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button><span class='glyphicon glyphicon-warning-sign'></span> The password retrieval answer provided is invalid. Please check the value and try again.</div></div>"; break; case MembershipCreateStatus.InvalidQuestion: txtError.Text = "<div class='form-group col-xs-12 col-lg-12'><div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button><span class='glyphicon glyphicon-warning-sign'></span> The password retrieval question provided is invalid. Please check the value and try again.</div></div>"; break; case MembershipCreateStatus.InvalidUserName: txtError.Text = "<div class='form-group col-xs-12 col-lg-12'><div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button><span class='glyphicon glyphicon-warning-sign'></span> The user name provided is invalid. Please check the value and try again.</div></div>"; break; case MembershipCreateStatus.ProviderError: txtError.Text = "<div class='form-group col-xs-12 col-lg-12'><div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button><span class='glyphicon glyphicon-warning-sign'></span> The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator.</div></div>"; break; case MembershipCreateStatus.UserRejected: txtError.Text = "<div class='form-group col-xs-12 col-lg-12'><div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button><span class='glyphicon glyphicon-warning-sign'></span> The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator.</div></div>"; break; default: txtError.Text = "<div class='form-group col-xs-12 col-lg-12'><div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button><span class='glyphicon glyphicon-warning-sign'></span> An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator.</div></div>"; break; } }
protected void OnCreateUserError(object sender, CreateUserErrorEventArgs e) { if (sender == null) { return; } if (e == null) { return; } _state = State.Failed; _currentErrorText = "An error has occurred. Please try again."; CreateUserWizard wizard = Control as CreateUserWizard; if (wizard != null) { _currentErrorText = wizard.UnknownErrorMessage; switch (e.CreateUserError) { case MembershipCreateStatus.DuplicateEmail: _currentErrorText = wizard.DuplicateEmailErrorMessage; break; case MembershipCreateStatus.DuplicateUserName: _currentErrorText = wizard.DuplicateUserNameErrorMessage; break; case MembershipCreateStatus.InvalidAnswer: _currentErrorText = wizard.InvalidAnswerErrorMessage; break; case MembershipCreateStatus.InvalidEmail: _currentErrorText = wizard.InvalidEmailErrorMessage; break; case MembershipCreateStatus.InvalidPassword: _currentErrorText = wizard.InvalidPasswordErrorMessage; break; case MembershipCreateStatus.InvalidQuestion: _currentErrorText = wizard.InvalidQuestionErrorMessage; break; } } }
protected void createWizard_CreateUserError(object sender, CreateUserErrorEventArgs e) { divMsg.Visible = true; string sFieldValue = e.CreateUserError.ToString(); CreateUserWizard cw = (CreateUserWizard)sender; if (cw != null) { object objData = ReflectionUtilities.GetPropertyValue(cw, e.CreateUserError.ToString() + "ErrorMessage"); if (objData != null) { sFieldValue = string.Format("{0}", objData); } } FailureText.Text = sFieldValue; }
protected void CreateUserWizard1CreateUserError(object sender, CreateUserErrorEventArgs e) { string sMessage = ""; switch (e.CreateUserError) { case MembershipCreateStatus.DuplicateEmail: sMessage = CreateUserWizard1.DuplicateEmailErrorMessage; break; case MembershipCreateStatus.DuplicateUserName: sMessage = CreateUserWizard1.DuplicateUserNameErrorMessage; break; case MembershipCreateStatus.InvalidAnswer: sMessage = CreateUserWizard1.InvalidAnswerErrorMessage; break; case MembershipCreateStatus.InvalidEmail: sMessage = CreateUserWizard1.InvalidEmailErrorMessage; break; case MembershipCreateStatus.InvalidPassword: sMessage = String.Format(CreateUserWizard1.InvalidPasswordErrorMessage, Membership.Provider.MinRequiredPasswordLength, Membership.Provider.MinRequiredNonAlphanumericCharacters); break; case MembershipCreateStatus.InvalidQuestion: sMessage = CreateUserWizard1.InvalidQuestionErrorMessage; break; case MembershipCreateStatus.InvalidUserName: sMessage = "Username is not valid"; break; case MembershipCreateStatus.ProviderError: sMessage = "Something went wrong in the provider"; break; case MembershipCreateStatus.UserRejected: sMessage = "Administrator said NO WAY!"; break; } var cvError = new CustomValidator { ValidationGroup = "CreateUserWizard1", ErrorMessage = sMessage, IsValid = false }; CreateUserWizard1.CreateUserStep.ContentTemplateContainer.Controls.Add(cvError); }
/// <summary> /// Handles the CreateUserError event of the CreateUserWizard1 control. /// </summary> /// <param name="sender"> /// The source of the event. /// </param> /// <param name="e"> /// The <see cref="CreateUserErrorEventArgs"/> instance containing the event data. /// </param> protected void CreateUserWizard1_CreateUserError([NotNull] object sender, [NotNull] CreateUserErrorEventArgs e) { // find the type of error var createUserError = e.CreateUserError switch { MembershipCreateStatus.DuplicateEmail => this.GetText("ALREADY_REGISTERED"), MembershipCreateStatus.DuplicateUserName => this.GetText("ALREADY_REGISTERED"), MembershipCreateStatus.InvalidEmail => this.GetText("BAD_EMAIL"), MembershipCreateStatus.InvalidPassword => this.GetText("BAD_PASSWORD"), MembershipCreateStatus.InvalidQuestion => this.GetText("INVALID_QUESTION"), MembershipCreateStatus.InvalidUserName => this.GetText("INVALID_USERNAME"), MembershipCreateStatus.InvalidAnswer => this.GetText("INVALID_ANSWER"), MembershipCreateStatus.InvalidProviderUserKey => "Invalid provider user key.", MembershipCreateStatus.DuplicateProviderUserKey => "Duplicate provider user key.", MembershipCreateStatus.ProviderError => "Provider Error", MembershipCreateStatus.UserRejected => "User creation failed: Reason is defined by the provider.", _ => string.Empty }; this.PageContext.AddLoadMessage(createUserError, MessageTypes.danger); }
protected void CreateUserWizard1_OnCreateUserError(object sender, CreateUserErrorEventArgs e) { CompleteWizardStep1.Title = "Fail!"; }
protected void CreateUserWizard1_CreateUserError(object sender, CreateUserErrorEventArgs e) { //e.CreateUserError == MembershipCreateStatus. }
protected void CreateUserWizard_CreateUserError(object sender, CreateUserErrorEventArgs e) { Flash.Attributes["class"] = "flash_alert"; lblInfo.Text = "Error en la creación de cuenta"; }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void CreateUserWizard1_CreateUserError(object sender, CreateUserErrorEventArgs e) { MembershipCreateStatus status = e.CreateUserError; this.ErrorLabel.Text = status.ToString(); }
protected void CreateUserWizard1_CreateUserError(object sender, CreateUserErrorEventArgs e) { SystemMessages.DisplaySystemErrorMessage(Resources.UserData.MessageErrorCreateMembership); }
protected void OnCreateUserError(object sender, CreateUserErrorEventArgs e) { }
protected void SandlerCreateUserWizard_CreateUserError(object sender, CreateUserErrorEventArgs e) { MembershipCreateStatus s = e.CreateUserError; }
protected void CreateUserWizard1_CreateUserError(object sender, CreateUserErrorEventArgs e) { //Response.Redirect("customError.aspx?Error=" + e.CreateUserError + "### CreateUser"); }