for(int nA = 0; nA < CheckBoxList1.Items.Count; nA ++)
        {
            if(CheckBoxList1.Items[nA].Selected == true)
            {
                lia.Demand = CheckBoxList1.Items[nA].Text;
            }
        }这个取值的方法对吗?为什么我只能获取CheckBoxList中的一个值?
大侠们请帮帮小弟

解决方案 »

  1.   

    lia.Demand += CheckBoxList1.Items[nA].Text;
      

  2.   

    lia.Demand = CheckBoxList1.Items[nA].Text;
      

  3.   

    for(int nA = 0; nA < CheckBoxList1.Items.Count; nA ++)
            {
                if(CheckBoxList1.Items[nA].Selected == true)
                {
                    lia.Demand += CheckBoxList1.Items[nA].Text;
                }
            }
      

  4.   

    :) 还回个逗号分开一下
    lia.Demand += CheckBoxList1.Items[nA].Text+","  //
      

  5.   


    这句:lia.Demand = CheckBoxList1.Items[nA].Text;改成:lia.Demand += CheckBoxList1.Items[nA].Text;
      

  6.   

    http://blog.csdn.net/downmoon/archive/2007/07/26/1709929.aspx