當前位置: 首頁>>代碼示例>>C#>>正文


C# HtmlInputCheckBox.RenderControl方法代碼示例

本文整理匯總了C#中System.Web.UI.HtmlControls.HtmlInputCheckBox.RenderControl方法的典型用法代碼示例。如果您正苦於以下問題:C# HtmlInputCheckBox.RenderControl方法的具體用法?C# HtmlInputCheckBox.RenderControl怎麽用?C# HtmlInputCheckBox.RenderControl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Web.UI.HtmlControls.HtmlInputCheckBox的用法示例。


在下文中一共展示了HtmlInputCheckBox.RenderControl方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RenderDivShowHide

        private void RenderDivShowHide(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "itemlistcontainer");
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID + "_DivShowHide");
            writer.AddAttribute("itemalign", ItemAlign.ToString());
            writer.AddAttribute(HtmlTextWriterAttribute.Style, "display: none; z-index: 500;");

            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Style, "padding: 5px;");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            RenderCheckBoxDiv(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "divconfirm");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (ShowCheckAll && SingleMode == SingledType.NotSet)
            {
                HtmlInputCheckBox cb = new HtmlInputCheckBox();
                cb.ID = this.ClientID + "_SelectAll";
                cb.Attributes.Add("onclick", "CheckBoxSelectAll('" + this.ClientID + "');");
                cb.RenderControl(writer);

                writer.AddAttribute("for", this.ClientID + "_SelectAll");
                writer.RenderBeginTag(HtmlTextWriterTag.Label);
                writer.Write("全選 ");
                writer.RenderEndTag();
                writer.Write(" ");
            }

            HtmlInputButton confirm = new HtmlInputButton();
            confirm.Value = "確 定";
            confirm.Attributes.Add("class", "btn");
            confirm.Attributes.Add("onclick", "CheckBoxListConfirm('" + this.ClientID + "'); HideComboBoxDiv('" + this.ClientID + "');");
            confirm.RenderControl(writer);

            writer.Write(" ");

            HtmlInputButton cancel = new HtmlInputButton();
            cancel.Value = "取 消";
            cancel.Attributes.Add("class", "btn");
            cancel.Attributes.Add("onclick", "HideComboBoxDiv('" + this.ClientID + "');");
            cancel.RenderControl(writer);

            writer.RenderEndTag();
            writer.RenderEndTag();
        }
開發者ID:dollarsxu,項目名稱:ComboBox,代碼行數:48,代碼來源:CheckBoxExtend.cs


注:本文中的System.Web.UI.HtmlControls.HtmlInputCheckBox.RenderControl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。