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 WriteConfirmNewPasswordPanel(HtmlTextWriter writer, ChangePassword changePwd)
        {
            TextBox textbox = changePwd.ChangePasswordTemplateContainer.FindControl("ConfirmNewPassword") as TextBox;

            if (textbox != null)
            {
                Page.ClientScript.RegisterForEventValidation(textbox.UniqueID);
                WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-ChangePassword-ConfirmNewPasswordPanel", "");
                Extender.WriteTextBox(writer, true, changePwd.LabelStyle.CssClass, changePwd.ConfirmNewPasswordLabelText, changePwd.TextBoxStyle.CssClass, changePwd.ChangePasswordTemplateContainer.ID + "_ConfirmNewPassword", "");
                WebControlAdapterExtender.WriteRequiredFieldValidator(writer, changePwd.ChangePasswordTemplateContainer.FindControl("ConfirmNewPasswordRequired") as RequiredFieldValidator, changePwd.ValidatorTextStyle.CssClass, "ConfirmNewPassword", changePwd.ConfirmPasswordRequiredErrorMessage);
                WebControlAdapterExtender.WriteCompareValidator(writer, changePwd.ChangePasswordTemplateContainer.FindControl("NewPasswordCompare") as CompareValidator, changePwd.ValidatorTextStyle.CssClass, "ConfirmNewPassword", changePwd.ConfirmPasswordCompareErrorMessage, "NewPassword");
                WebControlAdapterExtender.WriteEndDiv(writer);
            }
        }