zoukankan      html  css  js  c++  java
  • Repeater 得到checkbox值

     Repeater外面事件得到Checkbox值 Checkbox必须是服务器控件

    <input type="checkbox" name="checkbox2" id="checkid" runat="server"/>

    foreach (RepeaterItem item in this.repjoblist.Items)
                {
                    if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
                    {
                        //CheckBox cb = item.FindControl("checkid") as CheckBox;
                        HtmlInputCheckBox cb = item.FindControl("checkid") as HtmlInputCheckBox;
                        if (cb.Checked)
                        {

                        }
                    }
                }


                //for (int i = 0; i < this.repjoblist.Items.Count; i++)
                //{
                //    //CheckBox cb = (CheckBox)this.repjoblist.Items[i].FindControl("checkid");
                //    HtmlInputCheckBox cb = this.repjoblist.Items[i].FindControl("checkid") as HtmlInputCheckBox;
                //    if (cb != null)
                //    {
                //        if (cb.Checked)
                //        {               
                //        }
                //    }
                //}

  • 相关阅读:
    [poj2778]DNA Sequence(AC自动机+矩阵快速幂)
    密码学学习笔记
    [hdu3695]Computer Virus on Planet Pandora(AC自动机)
    [hdu1277]全文检索(AC自动机)
    [hdu3065]病毒侵袭持续中(AC自动机)
    [hdu2896]病毒侵袭(AC自动机)
    lintcode-84-落单的数 III
    lintcode-83-落单的数 II
    lintcode-79-最长公共子串
    lintcode-78-最长公共前缀
  • 原文地址:https://www.cnblogs.com/freexiaoyu/p/1785875.html
Copyright © 2011-2022 走看看