静态的可以!!
for (int i = 0;i < CheckBoxList1.Items.Count;i++)
{
    ListItem item  = CheckBoxList1.Items[i];
    if (item.Selected)
        Label1.Text += item.Text;
}
执行正确

解决方案 »

  1.   

    foreach(Listitem item in CheckBoxList1.Items)
    {
    if (item.Selected)
    .......
    }
    这样试试
      

  2.   

    不行
    现在发现问题是这样的:不管如何选择,CheckBoxList从第二个Item开始selected全部为true!!只有第一个item选择有效!!
      

  3.   

    下面是我写的一段代码,没有任何问题,你比较一下吧!
    private void Page_Load(object sender, System.EventArgs e)
    {
    if(!IsPostBack)
    {
    CheckBoxList1.Items.Add("a");
    CheckBoxList1.Items.Add("b");
    CheckBoxList1.Items.Add("c");
    }
    }
    private void Button1_Click(object sender, System.EventArgs e)
    {
    foreach(ListItem li in CheckBoxList1.Items)
    {
    if (li.Selected)
    {
    Label1.Text+=li.Text;
    }
    }
    }