如何获取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 == 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 == strTerms[i])
                        {
                            lItem.Selected = true;
                        }
                    }
                }

posted @ 2015-01-28 13:18  寒夜美美  阅读(556)  评论(0编辑  收藏  举报