获得CheckBoxList中选中了的值
1 /// <summary>
2 /// 得到CheckBoxList中选中了的值
3 /// </summary>
4 /// <param name="checkList">CheckBoxList</param>
5 /// <param name="separator">分割符号</param>
6 /// <returns></returns>
7 public static string GetCheckListText(CheckBoxList checkList)
8 {
9 string selval = "";
10 for(int i=0;i<checkList.Items.Count;i++)
11 {
12 if(checkList.Items[i].Selected )
13 {
14 if (checkList.Items[i].Text.IndexOf("其它") != -1)
15 {
16 selval += "|";
17 }
18 else
19 {
20 selval += checkList.Items[i].Text + "|";
21 }
22 }
23 }
24 return selval;
25 }
2 /// 得到CheckBoxList中选中了的值
3 /// </summary>
4 /// <param name="checkList">CheckBoxList</param>
5 /// <param name="separator">分割符号</param>
6 /// <returns></returns>
7 public static string GetCheckListText(CheckBoxList checkList)
8 {
9 string selval = "";
10 for(int i=0;i<checkList.Items.Count;i++)
11 {
12 if(checkList.Items[i].Selected )
13 {
14 if (checkList.Items[i].Text.IndexOf("其它") != -1)
15 {
16 selval += "|";
17 }
18 else
19 {
20 selval += checkList.Items[i].Text + "|";
21 }
22 }
23 }
24 return selval;
25 }