void InstantiateCreateUserWizardStep (CreateUserWizardStep step)
		{
			CreateUserStepContainer contentTemplateContainer = new CreateUserStepContainer (this);
			if (step.ContentTemplate != null) {
				step.ContentTemplate.InstantiateIn (contentTemplateContainer.InnerCell);
			}
			else {
				new CreateUserStepTemplate (this).InstantiateIn (contentTemplateContainer.InnerCell);
				contentTemplateContainer.ConfirmDefaultTemplate ();
				contentTemplateContainer.EnsureValidatorsState ();
			}

			step.ContentTemplateContainer = contentTemplateContainer;
			step.Controls.Clear ();
			step.Controls.Add (contentTemplateContainer);

			CreateUserNavigationContainer customNavigationTemplateContainer = new CreateUserNavigationContainer (this);
			if (step.CustomNavigationTemplate != null) {
				step.CustomNavigationTemplate.InstantiateIn (customNavigationTemplateContainer);
			}
			else {
				new CreateUserStepNavigationTemplate (this).InstantiateIn (customNavigationTemplateContainer);
				customNavigationTemplateContainer.ConfirmDefaultTemplate ();
			}
			RegisterCustomNavigation (step, customNavigationTemplateContainer);

			step.CustomNavigationTemplateContainer = customNavigationTemplateContainer;
		}
 private static void AddHelpPageLinkRow(Table table, CreateUserStepContainer container) {
     var row = CreateDoubleSpannedColumnRow(container.HelpPageIcon, container.HelpPageLink);
     table.Rows.Add(row);
 }
 internal override void InstantiateStepContentTemplates()
 {
     bool useInnerTable = this.LayoutTemplate == null;
     foreach (WizardStepBase base2 in this.WizardSteps)
     {
         if (base2 == this.CreateUserStep)
         {
             base2.Controls.Clear();
             this._createUserStepContainer = new CreateUserStepContainer(this, useInnerTable);
             this._createUserStepContainer.ID = "CreateUserStepContainer";
             ITemplate contentTemplate = this.CreateUserStep.ContentTemplate;
             if (contentTemplate == null)
             {
                 contentTemplate = new DefaultCreateUserContentTemplate(this);
             }
             else
             {
                 this._createUserStepContainer.SetEnableTheming();
             }
             contentTemplate.InstantiateIn(this._createUserStepContainer.Container);
             this.CreateUserStep.ContentTemplateContainer = this._createUserStepContainer;
             base2.Controls.Add(this._createUserStepContainer);
         }
         else if (base2 == this.CompleteStep)
         {
             base2.Controls.Clear();
             this._completeStepContainer = new CompleteStepContainer(this, useInnerTable);
             this._completeStepContainer.ID = "CompleteStepContainer";
             ITemplate template2 = this.CompleteStep.ContentTemplate;
             if (template2 == null)
             {
                 template2 = new DefaultCompleteStepContentTemplate(this._completeStepContainer);
             }
             else
             {
                 this._completeStepContainer.SetEnableTheming();
             }
             template2.InstantiateIn(this._completeStepContainer.Container);
             this.CompleteStep.ContentTemplateContainer = this._completeStepContainer;
             base2.Controls.Add(this._completeStepContainer);
         }
         else
         {
             TemplatedWizardStep step = base2 as TemplatedWizardStep;
             if (step != null)
             {
                 base.InstantiateStepContentTemplate(step);
             }
         }
     }
 }
 private void AddEmailRegexValidatorRow(Table table, CreateUserStepContainer container) {
     var row = CreateDoubleSpannedColumnRow(HorizontalAlign.Center, container.EmailRegExpValidator);
     _wizard._emailRegExpRow = row;
     table.Rows.Add(row);
 }
 private static void AddErrorMessageRow(Table table, CreateUserStepContainer container) {
     var row = CreateDoubleSpannedColumnRow(HorizontalAlign.Center, container.ErrorMessageLabel);
     table.Rows.Add(row);
 }
 private void AddAnswerRow(Table table, CreateUserStepContainer container) {
     if (_wizard.ConvertingToTemplate) {
         container.AnswerLabel.RenderAsLabel = true;
     }
     var row = CreateTwoColumnRow(container.AnswerLabel, container.AnswerTextBox, container.AnswerRequired);
     _wizard._answerRow = row;
     table.Rows.Add(row);
 }
 private void AddPasswordCompareValidatorRow(Table table, CreateUserStepContainer container) {
     var row = CreateDoubleSpannedColumnRow(HorizontalAlign.Center, container.PasswordCompareValidator);
     _wizard._passwordCompareRow = row;
     table.Rows.Add(row);
 }
            private void AddPasswordHintRow(Table table, CreateUserStepContainer container) {
                var row = CreateTableRow();

                var leftCell = CreateTableCell();
                row.Cells.Add(leftCell);

                var rightCell = CreateTableCell();
                rightCell.Controls.Add(container.PasswordHintLabel);
                row.Cells.Add(rightCell);

                _wizard._passwordHintTableRow = row;
                table.Rows.Add(row);
            }
 private void AddConfirmPasswordRow(Table table, CreateUserStepContainer container) {
     if (_wizard.ConvertingToTemplate) {
         container.ConfirmPasswordLabel.RenderAsLabel = true;
     }
     var rightCellColumns = new List<Control>() { container.ConfirmPasswordTextBox };
     if (!_wizard.AutoGeneratePassword) {
         rightCellColumns.Add(container.ConfirmPasswordRequired);
     }
     var row = CreateTwoColumnRow(container.ConfirmPasswordLabel, rightCellColumns.ToArray());
     _wizard._confirmPasswordTableRow = row;
     table.Rows.Add(row);
 }
 private void AddUserNameRow(Table table, CreateUserStepContainer container) {
     if (_wizard.ConvertingToTemplate) {
         container.UserNameLabel.RenderAsLabel = true;
     }
     var row = CreateTwoColumnRow(container.UserNameLabel, container.UserNameTextBox, container.UserNameRequired);
     table.Rows.Add(row);
 }
 private static void AddInstructionRow(Table table, CreateUserStepContainer container) {
     var row = CreateDoubleSpannedColumnRow(HorizontalAlign.Center, container.InstructionLabel);
     row.PreventAutoID();
     table.Rows.Add(row);
 }
            private void LayoutControls(CreateUserStepContainer container) {
                Table table = CreateTable();
                table.EnableViewState = false;

                AddTitleRow(table, container);
                AddInstructionRow(table, container);
                AddUserNameRow(table, container);
                AddPasswordRow(table, container);
                AddPasswordHintRow(table, container);
                AddConfirmPasswordRow(table, container);
                AddEmailRow(table, container);
                AddQuestionRow(table, container);
                AddAnswerRow(table, container);
                AddPasswordCompareValidatorRow(table, container);
                AddPasswordRegexValidatorRow(table, container);
                AddEmailRegexValidatorRow(table, container);
                AddErrorMessageRow(table, container);
                AddHelpPageLinkRow(table, container);

                container.AddChildControl(table);
            }
            private void ConstructControls(CreateUserStepContainer container) {
                string validationGroup = _wizard.ValidationGroup;

                container.Title = CreateLiteral();
                container.InstructionLabel = CreateLiteral();
                container.PasswordHintLabel = CreateLiteral();

                container.UserNameTextBox = new TextBox() {
                    ID = _userNameID
                };

                // Must explicitly set the ID of controls that raise postback events
                container.PasswordTextBox = new TextBox() {
                    ID = _passwordID,
                    TextMode = TextBoxMode.Password
                }; ;

                container.ConfirmPasswordTextBox = new TextBox() {
                    ID = _confirmPasswordID,
                    TextMode = TextBoxMode.Password
                };

                bool enableValidation = true;
                container.UserNameRequired = CreateRequiredFieldValidator(_userNameRequiredID, validationGroup, container.UserNameTextBox, enableValidation);

                container.UserNameLabel = CreateLabelLiteral(container.UserNameTextBox);
                container.PasswordLabel = CreateLabelLiteral(container.PasswordTextBox);
                container.ConfirmPasswordLabel = CreateLabelLiteral(container.ConfirmPasswordTextBox);

                Image helpPageIcon = new Image();
                helpPageIcon.PreventAutoID();
                container.HelpPageIcon = helpPageIcon;

                container.HelpPageLink = new HyperLink() {
                    ID = _helpLinkID
                };

                container.ErrorMessageLabel = new Literal() {
                    ID = _errorMessageID
                };

                container.EmailTextBox = new TextBox() {
                    ID = _emailID
                };

                container.EmailRequired = CreateRequiredFieldValidator(_emailRequiredID, validationGroup, container.EmailTextBox, enableValidation);
                container.EmailLabel = CreateLabelLiteral(container.EmailTextBox);

                container.EmailRegExpValidator = new RegularExpressionValidator() {
                    ID = _emailRegExpID,
                    ControlToValidate = _emailID,
                    ErrorMessage = _wizard.EmailRegularExpressionErrorMessage,
                    ValidationExpression = _wizard.EmailRegularExpression,
                    ValidationGroup = validationGroup,
                    Display = _regexpFieldValidatorDisplay,
                    Enabled = enableValidation,
                    Visible = enableValidation
                };

                container.PasswordRequired = CreateRequiredFieldValidator(_passwordRequiredID, validationGroup, container.PasswordTextBox, enableValidation);
                container.ConfirmPasswordRequired = CreateRequiredFieldValidator(_confirmPasswordRequiredID, validationGroup, container.ConfirmPasswordTextBox, enableValidation);

                container.PasswordRegExpValidator = new RegularExpressionValidator() {
                    ID = _passwordRegExpID,
                    ControlToValidate = _passwordID,
                    ErrorMessage = _wizard.PasswordRegularExpressionErrorMessage,
                    ValidationExpression = _wizard.PasswordRegularExpression,
                    ValidationGroup = validationGroup,
                    Display = _regexpFieldValidatorDisplay,
                    Enabled = enableValidation,
                    Visible = enableValidation,
                };

                container.PasswordCompareValidator = new CompareValidator() {
                    ID = _passwordCompareID,
                    ControlToValidate = _confirmPasswordID,
                    ControlToCompare = _passwordID,
                    Operator = ValidationCompareOperator.Equal,
                    ErrorMessage = _wizard.ConfirmPasswordCompareErrorMessage,
                    ValidationGroup = validationGroup,
                    Display = _compareFieldValidatorDisplay,
                    Enabled = enableValidation,
                    Visible = enableValidation,
                };

                container.QuestionTextBox = new TextBox() {
                    ID = _questionID
                }; ;

                container.AnswerTextBox = new TextBox() {
                    ID = _answerID
                }; ;

                container.QuestionRequired = CreateRequiredFieldValidator(_questionRequiredID, validationGroup, container.QuestionTextBox, enableValidation);
                container.AnswerRequired = CreateRequiredFieldValidator(_answerRequiredID, validationGroup, container.AnswerTextBox, enableValidation);

                container.QuestionLabel = CreateLabelLiteral(container.QuestionTextBox);
                container.AnswerLabel = CreateLabelLiteral(container.AnswerTextBox);
            }
        /// <devdoc>
        ///     Instantiates all the content templates for each TemplatedWizardStep
        /// </devdoc>
        internal override void InstantiateStepContentTemplates() {
            bool useInnerTable = (LayoutTemplate == null);
            foreach (WizardStepBase step in WizardSteps) {
                if (step == CreateUserStep) {
                    step.Controls.Clear();
                    _createUserStepContainer = new CreateUserStepContainer(this, useInnerTable);
                    _createUserStepContainer.ID = _createUserStepContainerID;
                    ITemplate createUserStepTemplate = CreateUserStep.ContentTemplate;
                    if (createUserStepTemplate == null) {
                        createUserStepTemplate = new DefaultCreateUserContentTemplate(this);
                    } else {
                        _createUserStepContainer.SetEnableTheming();
                    }
                    createUserStepTemplate.InstantiateIn(_createUserStepContainer.Container);

                    CreateUserStep.ContentTemplateContainer = _createUserStepContainer;
                    step.Controls.Add(_createUserStepContainer);
                } else if (step == CompleteStep) {
                    step.Controls.Clear();
                    _completeStepContainer = new CompleteStepContainer(this, useInnerTable);
                    _completeStepContainer.ID = _completeStepContainerID;
                    ITemplate completeStepTemplate = CompleteStep.ContentTemplate;
                    if (completeStepTemplate == null) {
                        completeStepTemplate = new DefaultCompleteStepContentTemplate(_completeStepContainer);
                    }
                    else {
                        _completeStepContainer.SetEnableTheming();
                    }
                    completeStepTemplate.InstantiateIn(_completeStepContainer.Container);

                    CompleteStep.ContentTemplateContainer = _completeStepContainer;
                    step.Controls.Add(_completeStepContainer);
                } else {
                    var templatedStep = step as TemplatedWizardStep;
                    if (templatedStep != null) {
                        InstantiateStepContentTemplate(templatedStep);
                    }
                }
            }
        }