首页 > 代码库 > 如何获取checkboxlist的多个选中项

如何获取checkboxlist的多个选中项

                string[] array = dt.Rows[0]["s_type"].ToString().Split(‘|‘);
                foreach (ListItem m in cb_type.Items)
                {
                    for (int i = 0; i < array.Length; i++)
                    {
                        if (m.Value =http://www.mamicode.com/= array[i])
                        {
                            m.Selected = true;
                        }
                    }
                }
                string[] strTerms = dt.Rows[0]["s_zhandian"].ToString().Split(‘|‘);
                foreach (ListItem lItem in CB_zhandian.Items)
                {
                    for (int i = 0; i < strTerms.Length; i++)
                    {
                        if (lItem.Value =http://www.mamicode.com/= strTerms[i])
                        {
                            lItem.Selected = true;
                        }
                    }
                }

如何获取checkboxlist的多个选中项