日期:2014-05-19  浏览次数:20924 次

关于CheckBoxList的问题
//================a.aspx如下:===================//
<asp:CheckBoxList   ID= "Certification "   RepeatDirection= "Horizontal "   runat= "server ">
<asp:ListItem   Value= "ISO-9000 "   Text= "ISO-9000 "> </asp:ListItem>
<asp:ListItem   Value= "ISO-9002 "   Text= "ISO-9002 "> </asp:ListItem>
<asp:ListItem   Value= "ISO-9003 "   Text= "ISO-9003 "> </asp:ListItem>
<asp:ListItem   Value= "ISO-9004 "   Text= "ISO-9004 "> </asp:ListItem>
<asp:ListItem   Value= "ISO-14000 "   Text= "ISO-14000 "> </asp:ListItem>
</asp:CheckBoxList>  

//================a.aspx.cs的Page_Load如下===================//
string   Cert   =   membershowok[ "CertificationList "].ToString();
string[]   CertID   =   Cert.Split( '   ');
                        for   (int   x   =   0;   x   <   CertID.Length-1;   x++)
                        {
                                switch   (CertID[x])
                                {
                                        case   "ISO-9000 ":
                                                Certification.Items[0].Selected   =   true;
                                                break;
                                        case   "ISO-9002 ":
                                                Certification.Items[1].Selected   =   true;
                                                break;
                                        case   "ISO-9003 ":
                                                Certification.Items[2].Selected   =   true;
                                                break;
                                        case   "ISO-9004 ":
                                                Certification.Items[3].Selected   =   true;