CheckBoxList控件得到选中的的值

    技术2022-05-20  45

      foreach (ListItem list in cblColor.Items)   {         if (list.Selected == true)        {              productColor += list.Value + "|";         }   }

     

     

     

     

     

    ---checkBoxList控件

    <asp:Label ID="Label2" runat="server" Width="144px" ForeColor="Red"></asp:Label>                 <asp:CheckBoxList ID="cblColor" runat="server" RepeatColumns="5">                     <asp:ListItem>红</asp:ListItem>                     <asp:ListItem>蓝</asp:ListItem>                     <asp:ListItem>绿</asp:ListItem>                     <asp:ListItem>黑</asp:ListItem>                     <asp:ListItem>白</asp:ListItem>                 </asp:CheckBoxList>


    最新回复(0)