private void ConstructControls(CreateUserWizard.CreateUserStepContainer container)
 {
     string validationGroup = this._wizard.ValidationGroup;
     container.Title = CreateUserWizard.CreateLiteral();
     container.InstructionLabel = CreateUserWizard.CreateLiteral();
     container.PasswordHintLabel = CreateUserWizard.CreateLiteral();
     TextBox box = new TextBox {
         ID = "UserName"
     };
     container.UserNameTextBox = box;
     TextBox box2 = new TextBox {
         ID = "Password",
         TextMode = TextBoxMode.Password
     };
     container.PasswordTextBox = box2;
     TextBox box3 = new TextBox {
         ID = "ConfirmPassword",
         TextMode = TextBoxMode.Password
     };
     container.ConfirmPasswordTextBox = box3;
     bool enableValidation = true;
     container.UserNameRequired = CreateUserWizard.CreateRequiredFieldValidator("UserNameRequired", validationGroup, container.UserNameTextBox, enableValidation);
     container.UserNameLabel = CreateUserWizard.CreateLabelLiteral(container.UserNameTextBox);
     container.PasswordLabel = CreateUserWizard.CreateLabelLiteral(container.PasswordTextBox);
     container.ConfirmPasswordLabel = CreateUserWizard.CreateLabelLiteral(container.ConfirmPasswordTextBox);
     Image image = new Image();
     image.PreventAutoID();
     container.HelpPageIcon = image;
     HyperLink link = new HyperLink {
         ID = "HelpLink"
     };
     container.HelpPageLink = link;
     Literal literal = new Literal {
         ID = "ErrorMessage"
     };
     container.ErrorMessageLabel = literal;
     TextBox box4 = new TextBox {
         ID = "Email"
     };
     container.EmailTextBox = box4;
     container.EmailRequired = CreateUserWizard.CreateRequiredFieldValidator("EmailRequired", validationGroup, container.EmailTextBox, enableValidation);
     container.EmailLabel = CreateUserWizard.CreateLabelLiteral(container.EmailTextBox);
     RegularExpressionValidator validator = new RegularExpressionValidator {
         ID = "EmailRegExp",
         ControlToValidate = "Email",
         ErrorMessage = this._wizard.EmailRegularExpressionErrorMessage,
         ValidationExpression = this._wizard.EmailRegularExpression,
         ValidationGroup = validationGroup,
         Display = ValidatorDisplay.Dynamic,
         Enabled = enableValidation,
         Visible = enableValidation
     };
     container.EmailRegExpValidator = validator;
     container.PasswordRequired = CreateUserWizard.CreateRequiredFieldValidator("PasswordRequired", validationGroup, container.PasswordTextBox, enableValidation);
     container.ConfirmPasswordRequired = CreateUserWizard.CreateRequiredFieldValidator("ConfirmPasswordRequired", validationGroup, container.ConfirmPasswordTextBox, enableValidation);
     RegularExpressionValidator validator2 = new RegularExpressionValidator {
         ID = "PasswordRegExp",
         ControlToValidate = "Password",
         ErrorMessage = this._wizard.PasswordRegularExpressionErrorMessage,
         ValidationExpression = this._wizard.PasswordRegularExpression,
         ValidationGroup = validationGroup,
         Display = ValidatorDisplay.Dynamic,
         Enabled = enableValidation,
         Visible = enableValidation
     };
     container.PasswordRegExpValidator = validator2;
     CompareValidator validator3 = new CompareValidator {
         ID = "PasswordCompare",
         ControlToValidate = "ConfirmPassword",
         ControlToCompare = "Password",
         Operator = ValidationCompareOperator.Equal,
         ErrorMessage = this._wizard.ConfirmPasswordCompareErrorMessage,
         ValidationGroup = validationGroup,
         Display = ValidatorDisplay.Dynamic,
         Enabled = enableValidation,
         Visible = enableValidation
     };
     container.PasswordCompareValidator = validator3;
     TextBox box5 = new TextBox {
         ID = "Question"
     };
     container.QuestionTextBox = box5;
     TextBox box6 = new TextBox {
         ID = "Answer"
     };
     container.AnswerTextBox = box6;
     container.QuestionRequired = CreateUserWizard.CreateRequiredFieldValidator("QuestionRequired", validationGroup, container.QuestionTextBox, enableValidation);
     container.AnswerRequired = CreateUserWizard.CreateRequiredFieldValidator("AnswerRequired", validationGroup, container.AnswerTextBox, enableValidation);
     container.QuestionLabel = CreateUserWizard.CreateLabelLiteral(container.QuestionTextBox);
     container.AnswerLabel = CreateUserWizard.CreateLabelLiteral(container.AnswerTextBox);
 }
            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);
            }