Esempio n. 1
0
        /// <summary>
        /// Renders control.
        /// </summary>
        /// <param name="writer">The HtmlTextWriter to render content to.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            this.EnsureValidator();

            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlBeginTag(this.Required && this.ShowRequired, writer);
            }

            if (m_Validator != null)
            {
                m_Validator.Visible = false;
            }
            base.Render(writer);
            if (m_Validator != null)
            {
                m_Validator.Visible = true;
            }

            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlEndTag(m_Validator, this.Required, this.DesignMode, this.ErrorMessage, writer);
            }
            else if (m_Validator != null)
            {
                m_Validator.RenderControl(writer);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Renders control.
        /// </summary>
        /// <param name="writer">The HtmlTextWriter to render content to.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            if (writer == null)
            {
                return;
            }

            bool renderSecondRow = ((Required || (RangeValidation && ValidationType != CustomValidationDataType.String) || RegularExpressionValidation) &&
                                    Enabled && (!ReadOnly));

            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlBeginTag(Required && ShowRequired, writer, this.Width);
            }

            if (Masked)
            {
                if (!this.Width.IsEmpty)
                {
                    m_RadMaskedTextBox.Width = ((this.Theme == MasterPageTheme.Modern) ? this.Width : Unit.Percentage(100));
                }
                m_RadMaskedTextBox.RenderControl(writer);
            }
            else
            {
                if (!this.Width.IsEmpty)
                {
                    m_TextBox.Width = ((this.Theme == MasterPageTheme.Modern) ? this.Width : Unit.Percentage(100));
                }
                if (MultiLineMode && (MaxLength > 0))
                {
                    m_TextBox.Attributes.Add("maxLength", MaxLength.ToString(CultureInfo.CurrentCulture));
                }
                m_TextBox.RenderControl(writer);

                if (LengthInfoEnabled)
                {
                    string lengthInfoStringFormat = ((MaxLength > 0) ? Resources.TextBox_LengthInfoStringFormat2 : Resources.TextBox_LengthInfoStringFormat1);
                    writer.Write("<br />");
                    m_Span.RenderControl(writer);
                    writer.Write(string.Format(CultureInfo.CurrentCulture, " " + lengthInfoStringFormat, MaxLength));
                }
            }

            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlMiddleTag(renderSecondRow, writer);
            }

            this.RenderValidators(writer);

            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlEndTag(renderSecondRow, writer);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Renders control.
        /// </summary>
        /// <param name="writer">The HtmlTextWriter to render content to.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            if (!this.Visible)
            {
                return;
            }

            if ((!DesignMode) && string.IsNullOrEmpty(ErrorMessage) && (m_Validator != null))
            {
                m_Validator.ErrorMessage = (this.AllowCustomText ? Resources.ComboBox_RequiredValidator_ErrorMessage2 : Resources.ComboBox_RequiredValidator_ErrorMessage1);
            }

            if (this.Theme == MasterPageTheme.Modern)
            {
                if (m_Validator != null)
                {
                    base.OnClientSelectedIndexChanged = "ComboBox_SelectedIndexChanged";
                }
            }
            else
            {
                BaseValidatedControl.RenderValidatedControlBeginTag(this.Required && this.ShowRequired, writer, this.Width);
            }

            if (m_Validator != null)
            {
                m_Validator.Visible = false;
            }

            base.Render(writer);

            if (m_Validator != null)
            {
                m_Validator.Visible = true;
            }

            if (this.Theme == MasterPageTheme.Modern)
            {
                if (m_Validator != null)
                {
                    m_Validator.Attributes["controltovalidate2"] = this.ClientID + "_Input";
                    m_Validator.RenderControl(writer);
                }
            }
            else
            {
                BaseValidatedControl.RenderValidatedControlEndTag(m_Validator, this.Required, this.DesignMode, this.ErrorMessage, writer);
            }
        }
Esempio n. 4
0
        protected override void Render(HtmlTextWriter writer)
        {
            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlBeginTag(this.Required && this.ShowRequired, writer, this.Width);
            }

            base.Render(writer);

            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlEndTag(m_Validator, this.Required, this.DesignMode, this.ErrorMessage, writer);
            }
            else
            {
                m_Validator.RenderControl(writer);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Renders the control.
        /// </summary>
        /// <param name="writer">The HtmlTextWriter to render content to.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            if (string.IsNullOrEmpty(ErrorMessage))
            {
                ErrorMessage = Resources.CheckBoxList_RequiredValidator_ErrorMessage;
            }

            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlBeginTag(this.Required && this.ShowRequired, writer, this.Width);
            }

            base.Render(writer);

            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlEndTag(m_Validator, this.Required, this.DesignMode, this.ErrorMessage, writer);
            }
            else
            {
                m_Validator.RenderControl(writer);
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Renders control.
        /// </summary>
        /// <param name="writer">The HtmlTextWriter to render content to.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            EnsureChildControls();

            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlBeginTag(Required && ShowRequired, writer);
            }

            foreach (System.Web.UI.Control ctrl in Controls)
            {
                if (ctrl.Visible && (ctrl.ID != m_RequiredFieldValidator.ID))
                {
                    ctrl.RenderControl(writer);
                }
            }

            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlMiddleTag(Required, writer);
            }

            if (Required && Enabled)
            {
                if (!DesignMode && string.IsNullOrEmpty(m_RequiredFieldValidator.ErrorMessage))
                {
                    m_RequiredFieldValidator.ErrorMessage = Resources.TextBox_RequiredValidator_ErrorMessage;
                }
                m_RequiredFieldValidator.RenderControl(writer);
            }

            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlEndTag(Required, writer);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Renders control.
        /// </summary>
        /// <param name="writer">The HtmlTextWriter to render content to.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            if (writer == null)
            {
                return;
            }

            EnsureChildControls();

            m_DateStartPicker.DateInput.Skin = m_DateEndPicker.DateInput.Skin = "None";
            if (this.Theme == MasterPageTheme.Modern)
            {
                m_DateStartPicker.DateInput.EnabledStyle.CssClass
                              = m_DateStartPicker.DateInput.HoveredStyle.CssClass
                              = m_DateStartPicker.DateInput.FocusedStyle.CssClass
                              = m_DateEndPicker.DateInput.EnabledStyle.CssClass
                              = m_DateEndPicker.DateInput.HoveredStyle.CssClass
                              = m_DateEndPicker.DateInput.FocusedStyle.CssClass
                              = string.Empty;

                m_DateStartPicker.CssClass = m_DateEndPicker.CssClass = "DatePicker_Modern";
                m_DateStartPicker.DateInput.InvalidStyle.CssClass = m_DateEndPicker.DateInput.InvalidStyle.CssClass = "Invalid";
                m_DateStartPicker.DateInput.Width = m_DateEndPicker.DateInput.Width = Unit.Percentage(100);
            }

            m_StartLabel.Text = Resources.DateRange_StartDateLabel_Text;
            m_EndLabel.Text   = Resources.DateRange_EndDateLabel_Text;
            m_RangeLabel.Text = Resources.DateRange_DateRangeLabel_Text;

            if (DesignMode)
            {
                m_Validator.ErrorMessage = Resources.DateRange_CompareValidator_ErrorMessage;
                if (Required)
                {
                    m_Validator.ErrorMessage = Resources.DateRange_RequiredValidator_ErrorMessage + Resources.DateRange_ErrorMessage_Separator + m_Validator.ErrorMessage;
                }
            }
            else
            {
                if (m_RadCalendar != null)
                {
                    m_RadCalendar.RenderControl(writer);
                }
            }

            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlBeginTag(Required, writer);
            }

            writer.RenderBeginTag(HtmlTextWriterTag.Table); // Table
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);    // Tr1
            if (this.Theme == MasterPageTheme.Modern)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "172px");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Td); //Td1
            m_StartLabel.RenderControl(writer);
            writer.RenderEndTag();                       // Td1
            if (this.Theme == MasterPageTheme.Modern)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Width, "172px");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Td); // Td2
            m_EndLabel.RenderControl(writer);
            writer.RenderEndTag();                       // Td2

            if (ShowDateRange)
            {
                writer.RenderBeginTag(HtmlTextWriterTag.Td); // Td3
                m_RangeLabel.RenderControl(writer);
                writer.RenderEndTag();                       // Td3
            }

            writer.RenderEndTag();                       // Tr1

            writer.RenderBeginTag(HtmlTextWriterTag.Tr); // Tr2
            writer.RenderBeginTag(HtmlTextWriterTag.Td); // Td4
            m_DateStartPicker.RenderControl(writer);
            writer.RenderEndTag();                       // Td4
            writer.RenderBeginTag(HtmlTextWriterTag.Td); // Td5
            m_DateEndPicker.RenderControl(writer);
            writer.RenderEndTag();                       // Td5

            if (ShowDateRange)
            {
                writer.RenderBeginTag(HtmlTextWriterTag.Td); //Td6
                m_DateRange.RenderControl(writer);
                writer.RenderEndTag();                       // Td6
            }

            writer.RenderEndTag(); // Tr2
            writer.RenderEndTag(); // Table

            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlMiddleTag(true, writer);
            }

            m_Validator.RenderControl(writer);

            if (this.Theme != MasterPageTheme.Modern)
            {
                BaseValidatedControl.RenderValidatedControlEndTag(true, writer);
            }

            if (m_StartupScript != null)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), this.ClientID, m_StartupScript, true);
            }
        }