获得CheckBoxList中选定的值

 string MobileServices = "";

        for (int i = 0; i < MobileService.Items.Count; i++)
        {
            if (MobileService.Items[i].Selected == true)
                if (MobileServices=="")
                    MobileServices += "1";
                else
                    MobileServices += "_1";
            else
                if (MobileServices == "")
                    MobileServices += "0";
                else
                    MobileServices += "_0";

        }

        这样获得的MobileServices是一个类似 "1_0_1_1"的字符串

posted @ 2007-04-18 10:34  海底的鱼  阅读(300)  评论(0)    收藏  举报