Пример #1
0
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            using (var w = new HtmlTextWriterWithAttributeFilter(writer)) {
                Page.VerifyRenderingInServerForm(this);

                w.AddAttribute(HtmlTextWriterAttribute.Type, "radio");
                w.AddAttribute(HtmlTextWriterAttribute.Name, UniqueGroupName);
                if (Checked)
                {
                    w.AddAttribute(HtmlTextWriterAttribute.Checked, ((OSPage)Page).QuirksMode ? null : "checked");
                }

                bool old_Enabled = Enabled;
                if (!Enabled)
                {
                    w.AddAttribute(HtmlTextWriterAttribute.Disabled, ((OSPage)Page).QuirksMode ? null : "disabled");
                    Enabled = true;
                }

                // dump ajax onchange handler
                AjaxEventsHelper.AddAjaxEventAttribute(this, AjaxEventType.onAjaxChange, ClientID, UniqueID, "__OSVSTATE", ViewStateAttributes.InlineAttributes);

                base.AddAttributesToRender(w);
                ViewStateAttributes.InlineAttributes.AddAttributes(w);
                Enabled = old_Enabled;
            }
        }
Пример #2
0
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            Utils.RemoveIdIfAnonymous(this, Attributes);

            if (BorderWidth.IsEmpty)
            {
                // base.AddAttributesToRender forces border-width style attribute.
                // Here we want to explicitly ignore it
                string[] exclude = new string[] { HtmlTextWriterAttribute.Border.ToString(), HtmlTextWriterStyle.BorderWidth.ToString() };
                using (HtmlTextWriter w = new HtmlTextWriterWithAttributeFilter(writer, exclude)) {
                    base.AddAttributesToRender(w);
                }
            }
            else
            {
                string border = BorderWidth.Value.ToString();
                BorderWidth = Unit.Empty;

                if (Attributes["border"] != null)
                {
                    border = Attributes["border"].ToString();
                    Attributes.Remove("border");
                }
                BorderWidth = Unit.Parse(border);

                AjaxEventsHelper.AddAjaxEventAttribute(this, AjaxEventType.onAjaxClick, ClientID, UniqueID, "__OSVSTATE", Attributes);
                base.AddAttributesToRender(writer);
            }
        }
Пример #3
0
        //public override bool SupportsDisabledAttribute { get { return true; } }

        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            using (var w = new HtmlTextWriterWithAttributeFilter(writer)) {
                // add to class='' the Valid style
                if (!this._valid)
                {
                    string cssClass = this.CssClass;
                    if (cssClass != null && cssClass != "")
                    {
                        this.CssClass = this.CssClass + " Not_Valid";
                    }
                    else
                    {
                        this.CssClass = "Not_Valid";
                    }
                }

                // TODO JMR #585790 uncommend SupportsDisabledAttribute override and delete this block when targetting .net 4.0+
                bool old_Enabled = Enabled;
                if (!Enabled)
                {
                    w.AddAttribute(HtmlTextWriterAttribute.Disabled, ((OSPage)Page).QuirksMode ? null : "disabled");
                    Enabled = true;
                }

                // dump ajax onchange handler
                AjaxEventsHelper.AddAjaxEventAttribute(this, AjaxEventType.onAjaxChange, ClientID, UniqueID, "__OSVSTATE", ViewStateAttributes.InlineAttributes);
                base.AddAttributesToRender(w);
                ViewStateAttributes.InlineAttributes.AddAttributes(w);
                Enabled = old_Enabled;
            }
        }
        protected override void Render(HtmlTextWriter writer)
        {
            AjaxEventsHelper.AddAjaxEventAttribute(this, AjaxEventType.onAjaxClick, ClientID, UniqueID, "__OSVSTATE", ViewStateAttributes.InlineAttributes);
            ViewStateAttributes.InheritInlineAttributes();
            ViewStateAttributes.InlineAttributes.Add("class", _isEmpty ? (string.IsNullOrEmpty(CssClass) ? CssClass : CssClass + " ") + "Empty" : CssClass);

            // Render of the datagrid will be delegated in the child OSDataGridTable control
            base.Render(writer);
        }
Пример #5
0
        protected override void RenderBeginTag(HtmlTextWriter writer)
        {
            AjaxEventsHelper.AddAjaxEventAttribute(this, AjaxEventType.onAjaxClick, ClientID, UniqueID, "__OSVSTATE", Attributes);

            Utils.RemoveIdIfAnonymous(this, Attributes);

            writer.WriteBeginTag(_osTagName);
            this.RenderAttributes(writer);
            writer.Write('>');
        }
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            using (var w = new HtmlTextWriterWithAttributeFilter(writer)) {
                Page.VerifyRenderingInServerForm(this);

                w.AddAttribute(HtmlTextWriterAttribute.Name, base.UniqueID);

                bool old_Enabled = Enabled;
                if (!Enabled)
                {
                    w.AddAttribute(HtmlTextWriterAttribute.Disabled, ((OSPage)Page).QuirksMode ? null : "disabled");
                    Enabled = true;
                }

                // add to class='' the Mandatory style
                if (this._mandatory)
                {
                    string cssClass = this.CssClass;
                    if (cssClass != null && cssClass != "")
                    {
                        this.CssClass = this.CssClass + " Mandatory";
                    }
                    else
                    {
                        this.CssClass = "Mandatory";
                    }
                }

                // add to class='' the Valid style
                if (!this._valid)
                {
                    string cssClass = this.CssClass;
                    if (cssClass != null && cssClass != "")
                    {
                        this.CssClass = this.CssClass + " Not_Valid";
                    }
                    else
                    {
                        this.CssClass = "Not_Valid";
                    }
                }

                // dump ajax onchange handler
                AjaxEventsHelper.AddAjaxEventAttribute(this, AjaxEventType.onAjaxChange, ClientID, UniqueID, "__OSVSTATE", ViewStateAttributes.InlineAttributes);
                base.AddAttributesToRender(w);
                ViewStateAttributes.InlineAttributes.AddAttributes(w);
                Enabled = old_Enabled;
            }
        }
Пример #7
0
 public void OnAjaxClick(EventArgs e)
 {
     AjaxEventsHelper.RaiseAjaxEvent(this, AjaxClick);
 }
Пример #8
0
 public void OnAjaxChange(EventArgs e)
 {
     AjaxEventsHelper.RaiseAjaxEvent(this, AjaxChange);
 }
Пример #9
0
 protected override void RenderBeginTag(HtmlTextWriter writer)
 {
     AjaxEventsHelper.AddAjaxEventAttribute(this, AjaxEventType.onAjaxChange, ClientID, UniqueID, "__OSVSTATE", Attributes);
     base.RenderBeginTag(writer);
 }
Пример #10
0
 public void OnAjaxNotify(EventArgs e)
 {
     AjaxEventsHelper.RaiseAjaxEvent(this, AjaxNotify);
 }
Пример #11
0
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            using (var w = new HtmlTextWriterWithAttributeFilter(writer)) {
                Page.VerifyRenderingInServerForm(this);

                w.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID);

                TextBoxMode mode = this.TextMode;
                if (mode == TextBoxMode.MultiLine)
                {
                    int rows = this.Rows;
                    if (rows > 0)
                    {
                        w.AddAttribute(HtmlTextWriterAttribute.Rows, rows.ToString(NumberFormatInfo.InvariantInfo));
                    }
                    int cols = this.Columns;
                    if (cols > 0)
                    {
                        w.AddAttribute(HtmlTextWriterAttribute.Cols, cols.ToString(NumberFormatInfo.InvariantInfo));
                    }
                }
                else
                {
                    if (mode == TextBoxMode.SingleLine)
                    {
                        w.AddAttribute(HtmlTextWriterAttribute.Type, "text");
                        string value = this.Text;
                        if (value.Length > 0)
                        {
                            w.AddAttribute(HtmlTextWriterAttribute.Value, value);
                        }
                    }
                    else if (mode == TextBoxMode.Password)
                    {
                        w.AddAttribute(HtmlTextWriterAttribute.Type, "password");
                    }

                    int ml = this.MaxLength;
                    if (ml > 0)
                    {
                        w.AddAttribute(HtmlTextWriterAttribute.Maxlength, ml.ToString(NumberFormatInfo.InvariantInfo));
                    }
                    int size = this.Columns;
                    if (size > 0)
                    {
                        w.AddAttribute(HtmlTextWriterAttribute.Size, size.ToString(NumberFormatInfo.InvariantInfo));
                    }
                }

                if (this.ReadOnly)
                {
                    w.AddAttribute(HtmlTextWriterAttribute.ReadOnly, ((OSPage)Page).QuirksMode ? null : "readonly");
                }

                // [#35738] add to class='' the Mandatory style
                if (this._mandatory)
                {
                    string cssClass = this.CssClass;
                    if (cssClass != null && cssClass != "")
                    {
                        this.CssClass = this.CssClass + " Mandatory";
                    }
                    else
                    {
                        this.CssClass = "Mandatory";
                    }
                }

                // [#35738] add to class='' the Valid style
                if (!this._valid)
                {
                    string cssClass = this.CssClass;
                    if (cssClass != null && cssClass != "")
                    {
                        this.CssClass = this.CssClass + " Not_Valid";
                    }
                    else
                    {
                        this.CssClass = "Not_Valid";
                    }
                }

                // dump ajax onchange handler
                AjaxEventsHelper.AddAjaxEventAttribute(this, AjaxEventType.onAjaxChange, ClientID, UniqueID, "__OSVSTATE", ViewStateAttributes.InlineAttributes);
                base.AddAttributesToRender(w);
                ViewStateAttributes.InlineAttributes.AddAttributes(w);
            }
        }
 protected override void AddAttributesToRender(HtmlTextWriter writer)
 {
     AjaxEventsHelper.AddAjaxEventAttribute(this, AjaxEventType.onAjaxClick, ClientID, UniqueID, "__OSVSTATE", Attributes);
     Utils.RemoveIdIfAnonymous(this, Attributes);
     base.AddAttributesToRender(writer);
 }