How can I get the CheckBoxList selected values, what I have doesn't seem to work C#.NET/VisualWebPart

后端 未结 6 2097
盖世英雄少女心
盖世英雄少女心 2020-11-30 07:53

I am creating a CheckBoxList in a class file and am using an HTMLTextWriter to render the control.

I\'m using the following code to store the selected values in a s

6条回答
  •  独厮守ぢ
    2020-11-30 08:38

    check boxlist selected values with seperator

     string items = string.Empty;
            foreach (ListItem i in CheckBoxList1.Items)
            {
                if (i.Selected == true)
                {
                    items += i.Text + ",";
                }
            }
            Response.Write("selected items"+ items);
    

提交回复
热议问题