protected override void AddAttributesToRender(HtmlTextWriter writer)
 {
     if (this.renderUplevel)
     {
         base.EnsureID();
         string         clientID = this.ClientID;
         HtmlTextWriter writer2  = base.EnableLegacyRendering ? writer : null;
         if (this.HeaderText.Length > 0)
         {
             BaseValidator.AddExpandoAttribute(this, writer2, clientID, "headertext", this.HeaderText, true);
         }
         if (this.ShowMessageBox)
         {
             BaseValidator.AddExpandoAttribute(this, writer2, clientID, "showmessagebox", "True", false);
         }
         if (!this.ShowSummary)
         {
             BaseValidator.AddExpandoAttribute(this, writer2, clientID, "showsummary", "False", false);
         }
         if (this.DisplayMode != ValidationSummaryDisplayMode.BulletList)
         {
             BaseValidator.AddExpandoAttribute(this, writer2, clientID, "displaymode", PropertyConverter.EnumToString(typeof(ValidationSummaryDisplayMode), this.DisplayMode), false);
         }
         if (this.ValidationGroup.Length > 0)
         {
             BaseValidator.AddExpandoAttribute(this, writer2, clientID, "validationGroup", this.ValidationGroup, true);
         }
     }
     base.AddAttributesToRender(writer);
 }
        /// <internalonly/>
        /// <devdoc>
        ///    AddAttributesToRender method.
        /// </devdoc>
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            if (renderUplevel)
            {
                // We always want validation cotnrols to have an id on the client
                EnsureID();
                string id = ClientID;

                // DevDiv 33149: A backward compat. switch for Everett rendering
                HtmlTextWriter expandoAttributeWriter = (EnableLegacyRendering || IsUnobtrusive) ? writer : null;

                if (IsUnobtrusive)
                {
                    Attributes["data-valsummary"] = "true";
                }

                if (HeaderText.Length > 0)
                {
                    BaseValidator.AddExpandoAttribute(this, expandoAttributeWriter, id, "headertext", HeaderText, true);
                }
                if (ShowMessageBox)
                {
                    BaseValidator.AddExpandoAttribute(this, expandoAttributeWriter, id, "showmessagebox", "True", false);
                }
                if (!ShowSummary)
                {
                    BaseValidator.AddExpandoAttribute(this, expandoAttributeWriter, id, "showsummary", "False", false);
                }
                if (DisplayMode != ValidationSummaryDisplayMode.BulletList)
                {
                    BaseValidator.AddExpandoAttribute(this, expandoAttributeWriter, id, "displaymode", PropertyConverter.EnumToString(typeof(ValidationSummaryDisplayMode), DisplayMode), false);
                }
                if (ValidationGroup.Length > 0)
                {
                    BaseValidator.AddExpandoAttribute(this, expandoAttributeWriter, id, "validationGroup", ValidationGroup, true);
                }
            }

            base.AddAttributesToRender(writer);
        }