• 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)
                //        {               
                //        }
                //    }
                //}

  • 相关阅读:
    STM32学习中出现的错误
    原码 反码 补码 移码
    LiauidCrystal
    gpio 的配置
    ARM7探究
    导轨控制问题
    A4988驱动42步进电机
    arduino驱动oled
    计算机组成原理
    arduino basic issue
  • 原文地址:https://www.cnblogs.com/freexiaoyu/p/1785875.html
Copyright © 2020-2023  润新知