c# - DropDownCheckBoxes 不响应 ASP.NET 中的 Bootstrap 类

标签 c# css asp.net

我在 ASP.NET 页面中使用 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>

之前,我该如何解决?

最佳答案

您可以使用“Bootstrap Dropdown-checkbox”来实现带复选框的下拉菜单。

所有你需要做的如下:-

安装

  1. 添加 jQuery 和 Bootstrap。

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

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

  3. 在该部分之后添加:

link rel="stylesheet" type="text/css" href="/path/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/

关于c# - DropDownCheckBoxes 不响应 ASP.NET 中的 Bootstrap 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40506542/

相关文章:

c# - Datagridview AutoSizeColumnsMode 不工作

asp.net - Paypal 在交易后从不重定向到我的网站

javascript - 对动态填充的列表框进行排序

c# - 如何在 C# 中测试 COM 依赖对象

c# - 程序不包含适合入口点的静态 'main' 方法

c# - 如何滚动到列表框的底部?

html - 在电子邮件正文中应用 HTML 格式

html - 以百分比设置高度时在 Chrome 和 Firefox 上获得不同的输出

css - 将子内容分别包装到主父宽度

c# - ASP.NET MVC : Requested registry access denied when creating performance counters