有时候需要在其它的方法中遍历数据控件中的项:

foreach (RepeaterItem item in this.rptList.Items)
            {
                if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)//Repeater控件中的类型==指定列表控件中的类型
                {
                    HtmlInputCheckBox cb = item.FindControl("cb") as HtmlInputCheckBox;
                    if (cb != null && cb.Checked)
                    {//获取选中的checkbox的值

                        guid = cb.Value;
                        break;
                    }
                }
            }

相关文章:

  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-03
  • 2022-12-23
  • 2021-07-24
  • 2021-12-22
  • 2021-05-17
  • 2022-12-23
  • 2021-12-01
相关资源
相似解决方案