private void WriteCreateUserButtonPanel(HtmlTextWriter writer, CreateUserWizard wizard)
        {
            Control btnParentCtrl = wizard.FindControl("__CustomNav0");
            if (btnParentCtrl != null)
            {
                string id = "_CustomNav0_StepNextButton";
                string idWithType = WebControlAdapterExtender.MakeIdWithButtonType("StepNextButton", wizard.CreateUserButtonType);
                Control btn = btnParentCtrl.FindControl(idWithType);
                if (btn != null)
                {
                    Page.ClientScript.RegisterForEventValidation(btn.UniqueID);

                    PostBackOptions options = new PostBackOptions(btn, "", "", false, false, false, false, true, wizard.ID);
                    string javascript = "javascript:" + Page.ClientScript.GetPostBackEventReference(options);
                    javascript = Page.Server.HtmlEncode(javascript);

                    WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-CreateUserWizard-CreateUserButtonPanel");

                    Extender.WriteSubmit(writer, wizard.CreateUserButtonType, wizard.CreateUserButtonStyle.CssClass, id, wizard.CreateUserButtonImageUrl, javascript, wizard.CreateUserButtonText);

                    if (wizard.DisplayCancelButton)
                    {
                        Extender.WriteSubmit(writer, wizard.CancelButtonType, wizard.CancelButtonStyle.CssClass, "_CustomNav0_CancelButton", wizard.CancelButtonImageUrl, "", wizard.CancelButtonText);
                    }

                    WebControlAdapterExtender.WriteEndDiv(writer);
                }
            }
        }
 private void WriteContinuePanel(HtmlTextWriter writer, CreateUserWizard wizard)
 {
     string id = "ContinueButton";
     string idWithType = WebControlAdapterExtender.MakeIdWithButtonType(id, wizard.ContinueButtonType);
     Control btn = wizard.FindControl("CompleteStepContainer").FindControl(idWithType);
     if (btn != null)
     {
         Page.ClientScript.RegisterForEventValidation(btn.UniqueID);
         WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-CreateUserWizard-ContinuePanel");
         Extender.WriteSubmit(writer, wizard.ContinueButtonType, wizard.ContinueButtonStyle.CssClass, "CompleteStepContainer_ContinueButton", wizard.ContinueButtonImageUrl, "", wizard.ContinueButtonText);
         WebControlAdapterExtender.WriteEndDiv(writer);
     }
 }
        private void WriteAnswerPanel(HtmlTextWriter writer, CreateUserWizard wizard)
        {
            if ((WizardMembershipProvider != null) && WizardMembershipProvider.RequiresQuestionAndAnswer)
            {
                TextBox textBox = wizard.FindControl("CreateUserStepContainer").FindControl("Answer") as TextBox;
                if (textBox != null)
                {
                    Page.ClientScript.RegisterForEventValidation(textBox.UniqueID);

                    WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-CreateUserWizard-AnswerPanel");
                    Extender.WriteTextBox(writer, false, wizard.LabelStyle.CssClass, wizard.AnswerLabelText, wizard.TextBoxStyle.CssClass, "CreateUserStepContainer_Answer", "");
                    WebControlAdapterExtender.WriteRequiredFieldValidator(writer, wizard.FindControl("CreateUserStepContainer").FindControl("AnswerRequired") as RequiredFieldValidator, wizard.ValidatorTextStyle.CssClass, "Answer", wizard.AnswerRequiredErrorMessage);
                    WebControlAdapterExtender.WriteEndDiv(writer);
                }
            }
        }
 private void WriteFinalValidators(HtmlTextWriter writer, CreateUserWizard wizard)
 {
     WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-CreateUserWizard-FinalValidatorsPanel");
     WebControlAdapterExtender.WriteCompareValidator(writer, wizard.FindControl("CreateUserStepContainer").FindControl("PasswordCompare") as CompareValidator, wizard.ValidatorTextStyle.CssClass, "ConfirmPassword", wizard.ConfirmPasswordCompareErrorMessage, "Password");
     WebControlAdapterExtender.WriteRegularExpressionValidator(writer, wizard.FindControl("CreateUserStepContainer").FindControl("PasswordRegExpValidator") as RegularExpressionValidator, wizard.ValidatorTextStyle.CssClass, "Password", wizard.PasswordRegularExpressionErrorMessage, wizard.PasswordRegularExpression);
     WebControlAdapterExtender.WriteRegularExpressionValidator(writer, wizard.FindControl("CreateUserStepContainer").FindControl("EmailRegExpValidator") as RegularExpressionValidator, wizard.ValidatorTextStyle.CssClass, "Email", wizard.EmailRegularExpressionErrorMessage, wizard.EmailRegularExpression);
     WebControlAdapterExtender.WriteEndDiv(writer);
 }
        private void WriteEmailPanel(HtmlTextWriter writer, CreateUserWizard wizard)
        {
            TextBox textBox = wizard.FindControl("CreateUserStepContainer").FindControl("Email") as TextBox;
            if (textBox != null)
            {
                Page.ClientScript.RegisterForEventValidation(textBox.UniqueID);

                WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-CreateUserWizard-EmailPanel");
                Extender.WriteTextBox(writer, false, wizard.LabelStyle.CssClass, wizard.EmailLabelText, wizard.TextBoxStyle.CssClass, "CreateUserStepContainer_Email", "");
                WebControlAdapterExtender.WriteRequiredFieldValidator(writer, wizard.FindControl("CreateUserStepContainer").FindControl("EmailRequired") as RequiredFieldValidator, wizard.ValidatorTextStyle.CssClass, "Email", wizard.EmailRequiredErrorMessage);
                WebControlAdapterExtender.WriteEndDiv(writer);
            }
        }
        /// <summary>
        /// Writes the user panel.
        /// </summary>
        /// <param name="writer">
        /// The writer.
        /// </param>
        /// <param name="wizard">
        /// The wizard.
        /// </param>
        /// <remarks>
        /// </remarks>
        private void WriteUserPanel(HtmlTextWriter writer, CreateUserWizard wizard)
        {
            var textBox = wizard.FindControl("CreateUserStepContainer").FindControl("UserName") as TextBox;
            if (textBox == null)
            {
                return;
            }

            this.Page.ClientScript.RegisterForEventValidation(textBox.UniqueID);

            WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-CreateUserWizard-UserPanel", string.Empty);
            this.Extender.WriteTextBox(
                writer,
                false,
                wizard.LabelStyle.CssClass,
                wizard.UserNameLabelText,
                wizard.TextBoxStyle.CssClass,
                "CreateUserStepContainer_UserName",
                wizard.UserName);
            WebControlAdapterExtender.WriteRequiredFieldValidator(
                writer,
                wizard.FindControl("CreateUserStepContainer").FindControl("UserNameRequired") as RequiredFieldValidator,
                wizard.ValidatorTextStyle.CssClass,
                "UserName",
                wizard.UserNameRequiredErrorMessage);
            WebControlAdapterExtender.WriteEndDiv(writer);
        }
        /// <summary>
        /// Writes the question panel.
        /// </summary>
        /// <param name="writer">
        /// The writer.
        /// </param>
        /// <param name="wizard">
        /// The wizard.
        /// </param>
        /// <remarks>
        /// </remarks>
        private void WriteQuestionPanel(HtmlTextWriter writer, CreateUserWizard wizard)
        {
            if ((this.WizardMembershipProvider == null) || !this.WizardMembershipProvider.RequiresQuestionAndAnswer)
            {
                return;
            }

            var textBox = wizard.FindControl("CreateUserStepContainer").FindControl("Question") as TextBox;
            if (textBox == null)
            {
                return;
            }

            this.Page.ClientScript.RegisterForEventValidation(textBox.UniqueID);

            WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-CreateUserWizard-QuestionPanel", string.Empty);
            this.Extender.WriteTextBox(
                writer,
                false,
                wizard.LabelStyle.CssClass,
                wizard.QuestionLabelText,
                wizard.TextBoxStyle.CssClass,
                "CreateUserStepContainer_Question",
                string.Empty);
            WebControlAdapterExtender.WriteRequiredFieldValidator(
                writer,
                wizard.FindControl("CreateUserStepContainer").FindControl("QuestionRequired") as RequiredFieldValidator,
                wizard.ValidatorTextStyle.CssClass,
                "Question",
                wizard.QuestionRequiredErrorMessage);
            WebControlAdapterExtender.WriteEndDiv(writer);
        }
        /// <summary>
        /// Writes the create user button panel.
        /// </summary>
        /// <param name="writer">
        /// The writer.
        /// </param>
        /// <param name="wizard">
        /// The wizard.
        /// </param>
        /// <remarks>
        /// </remarks>
        private void WriteCreateUserButtonPanel(HtmlTextWriter writer, CreateUserWizard wizard)
        {
            var btnParentCtrl = wizard.FindControl("__CustomNav0");
            if (btnParentCtrl == null)
            {
                return;
            }

            const string Id = "_CustomNav0_StepNextButton";
            var idWithType = WebControlAdapterExtender.MakeIdWithButtonType(
                "StepNextButton", wizard.CreateUserButtonType);
            var btn = btnParentCtrl.FindControl(idWithType);
            if (btn == null)
            {
                return;
            }

            this.Page.ClientScript.RegisterForEventValidation(btn.UniqueID);

            var options = new PostBackOptions(
                btn, string.Empty, string.Empty, false, false, false, true, true, wizard.ID);
            var javascript = "javascript:" + this.Page.ClientScript.GetPostBackEventReference(options);
            javascript = this.Page.Server.HtmlEncode(javascript);

            WebControlAdapterExtender.WriteBeginDiv(
                writer, "AspNet-CreateUserWizard-CreateUserButtonPanel", string.Empty);

            this.Extender.WriteSubmit(
                writer,
                wizard.CreateUserButtonType,
                wizard.CreateUserButtonStyle.CssClass,
                Id,
                wizard.CreateUserButtonImageUrl,
                javascript,
                wizard.CreateUserButtonText);

            if (wizard.DisplayCancelButton)
            {
                this.Extender.WriteSubmit(
                    writer,
                    wizard.CancelButtonType,
                    wizard.CancelButtonStyle.CssClass,
                    "_CustomNav0_CancelButton",
                    wizard.CancelButtonImageUrl,
                    string.Empty,
                    wizard.CancelButtonText);
            }

            WebControlAdapterExtender.WriteEndDiv(writer);
        }
        /// <summary>
        /// Writes the continue panel.
        /// </summary>
        /// <param name="writer">
        /// The writer.
        /// </param>
        /// <param name="wizard">
        /// The wizard.
        /// </param>
        /// <remarks>
        /// </remarks>
        private void WriteContinuePanel(HtmlTextWriter writer, CreateUserWizard wizard)
        {
            const string Id = "ContinueButton";
            var idWithType = WebControlAdapterExtender.MakeIdWithButtonType(Id, wizard.ContinueButtonType);
            var btn = wizard.FindControl("CompleteStepContainer").FindControl(idWithType);
            if (btn == null)
            {
                return;
            }

            this.Page.ClientScript.RegisterForEventValidation(btn.UniqueID);
            WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-CreateUserWizard-ContinuePanel", string.Empty);
            this.Extender.WriteSubmit(
                writer,
                wizard.ContinueButtonType,
                wizard.ContinueButtonStyle.CssClass,
                "CompleteStepContainer_ContinueButton",
                wizard.ContinueButtonImageUrl,
                string.Empty,
                wizard.ContinueButtonText);
            WebControlAdapterExtender.WriteEndDiv(writer);
        }