日期:2014-05-17  浏览次数:20882 次

CheckBoxList 多选 样式 jquery获取选择项 C#获取选择项
 .checkboxlist label
        {
            margin-right: 20px;
        }

 var label;
            $("#ddlplatform input:checkbox:checked").each(function () {
                label += $(this).next().html();
            });

 <asp:CheckBoxList ID="ddlplatform" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow"
                        CssClass="checkboxlist">
                        <asp:ListItem Value="APP">APP</asp:ListItem>
                        <asp:ListItem Value="移动触屏">移动触屏</asp:ListItem>
                        <asp:ListItem Value="PC">PC</asp:ListItem>
                        <asp:ListItem Value="微信">微信</asp:ListItem>
                        <asp:ListItem Value="微博">微博</asp:ListItem>
                    </asp:CheckBoxList>

 //使用平台
            string Platfrom = string.Empty;
            foreach (ListItem li in this.ddlplatform.Items)
            {
                if (li.Selected)
                {
                    Platfrom += li.Text + ",";
                }
            }
            Platfrom = Platfrom.TrimEnd(',');