Exemple #1
0
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            base.AddAttributesToRender(writer);
            if (EnableClientScript /*&& Page.AreValidatorsUplevel()*/)
            {
                /* force an ID here if we weren't assigned one */
                if (ID == null)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
                }



                if (HeaderText != string.Empty && HeaderText != null)
                {
                    writer.AddAttribute("headertext", HeaderText);
                }
                else
                {
                    if (_mensajeDeIntroduccion == string.Empty || _mensajeDeIntroduccion == null)
                    {
                        writer.AddAttribute("headertext", "Mensaje no configurado");
                    }
                    else
                    {
                        writer.AddAttribute("headertext", _mensajeDeIntroduccion);
                    }
                }

                if (ShowMessageBox)
                {
                    writer.AddAttribute("showmessagebox", ShowMessageBox.ToString());
                }

                if (ShowSummary == false)
                {
                    writer.AddAttribute("showsummary", ShowSummary.ToString());
                }

                if (DisplayMode != ValidationSummaryDisplayMode.BulletList)
                {
                    writer.AddAttribute("displaymode", DisplayMode.ToString());
                }

                /*if (!has_errors)
                 *  writer.AddStyleAttribute("display", "none");*/
            }
        }
Exemple #2
0
        // for 2.0: not XHTML attributes must be registered with RegisterExpandoAttribute
        // when it will be implemented, in this case WebUIValidation_2.0.js muist be refactored
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            base.AddAttributesToRender(writer);

#if NET_2_0
            if (EnableClientScript && pre_render_called && Page.AreValidatorsUplevel(ValidationGroup))
            {
#else
            if (EnableClientScript && pre_render_called && Page.AreValidatorsUplevel())
            {
#endif
                /* force an ID here if we weren't assigned one */
                if (ID == null)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
                }
#if NET_2_0
                if (ValidationGroup != String.Empty)
                {
                    RegisterExpandoAttribute(ClientID, "validationGroup", ValidationGroup);
                }

                if (HeaderText.Length > 0)
                {
                    RegisterExpandoAttribute(ClientID, "headertext", HeaderText);
                }

                if (ShowMessageBox)
                {
                    RegisterExpandoAttribute(ClientID, "showmessagebox", "True");
                }

                if (!ShowSummary)
                {
                    RegisterExpandoAttribute(ClientID, "showsummary", "False");
                }

                if (DisplayMode != ValidationSummaryDisplayMode.BulletList)
                {
                    RegisterExpandoAttribute(ClientID, "displaymode", DisplayMode.ToString());
                }
#else
                if (HeaderText != "")
                {
                    writer.AddAttribute("headertext", HeaderText);
                }

                if (ShowMessageBox)
                {
                    writer.AddAttribute("showmessagebox", ShowMessageBox.ToString());
                }

                if (ShowSummary == false)
                {
                    writer.AddAttribute("showsummary", ShowSummary.ToString());
                }

                if (DisplayMode != ValidationSummaryDisplayMode.BulletList)
                {
                    writer.AddAttribute("displaymode", DisplayMode.ToString());
                }
#endif

                if (!has_errors)
                {
                    writer.AddStyleAttribute("display", "none");
                }
            }
        }