在ASP.NET中,DropDownCheckBoxes对Bootstrap类没有响应

本文关键字:Bootstrap 响应 DropDownCheckBoxes ASP NET | 更新日期: 2023-09-27 18:17:17

我在ASP中使用DropDOwnCheckBox作为控件之一。网络页面。每次我尝试使用从Bootstrap的表单控制类,我没有得到任何响应。这是我的代码:

     <cc1:DropDownCheckBoxes ID="ddlChkBoxLst" CssClass="form-control" runat="server" Visible="False" UseSelectAllNode="False" AddJQueryReference="true">
                                    <%--<Style SelectBoxWidth="195" DropDownBoxBoxWidth="160" DropDownBoxBoxHeight="90"></Style>--%>
                                        <Items>
                                            <asp:ListItem Text="By Bank" Value="1"></asp:ListItem>
                                            <asp:ListItem Text="By Sector" Value="2"></asp:ListItem>
                                            <asp:ListItem Text="By Country" Value="3"></asp:ListItem>
                                            <asp:ListItem Text="By Investment Type" Value="4"></asp:ListItem>
                                            <asp:ListItem Text="By Location" Value="5"></asp:ListItem>
                                            <asp:ListItem Text="By Amount" Value="6"></asp:ListItem>
                                        </Items>
                                </cc1:DropDownCheckBoxes>

Before,我如何解决这个问题?

在ASP.NET中,DropDownCheckBoxes对Bootstrap类没有响应

你可以使用"Bootstrap dropdown -checkbox"来实现带复选框的下拉。

你所需要做的就是:-

安装

  1. 添加jQuery和Bootstrap。

  2. 添加到HTML正文和jQuery之后:-

    脚本类型"text/javascript" src="/path/bootstrap-dropdown-checkbox.js"

link rel="stylesheet" type="text/css"href = "/道路/bootstrap-dropdown-checkbox.css ">

你应该使用的HTML模板:

div class="myDropdownCheckbox"
然后,通过jQuery选择器:
var myData = [{id: 1, label: "Test" }];
$(".myDropdownCheckbox").dropdownCheckbox({
  data: myData,
  title: "Dropdown Checkbox"
});

详细信息:http://acquisio.github.io/bootstrap-dropdown-checkbox/