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

<input type="checkbox" name="checkbox2" />

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

相关文章:

  • 2021-09-07
  • 2021-11-04
  • 2021-09-08
  • 2021-09-06
  • 2021-07-22
  • 2022-12-23
  • 2021-06-22
猜你喜欢
  • 2022-12-23
  • 2021-11-17
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-23
相关资源
相似解决方案