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

  • 相关阅读:
    中国软件杯——基于计算机视觉的交通场景智能应用
    《架构实践--软件架构设计的过程》读书笔记
    《架构实践--软件架构设计的过程》读书笔记
    软件架构师Refined Architecture部分读后感
    pycharm安装TensorFlow失败如何解决
    python聚类树图
    极限测试三
    极限测试进度2
    极限测试进度1
    赛题分析
  • 原文地址:https://www.cnblogs.com/freexiaoyu/p/1785875.html
Copyright © 2011-2022 走看看