我刚刚下载了多选下拉列表,但我无法给出正确的设计。我不知道将链接和脚本放在我的页面中的何处。<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %><asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"> <asp:ListBox ID="ListBox1" runat="server"> <asp:ListItem Text="Mango" Value="1" /> <asp:ListItem Text="Apple" Value="2" /> <asp:ListItem Text="Banana" Value="3" /> <asp:ListItem Text="Guava" Value="4" /> <asp:ListItem Text="Orange" Value="5" /> </asp:ListBox> <!-- Include Twitter Bootstrap and jQuery: --> <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"/> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/bootstrap.min.js"></script> <!-- Include the plugin's CSS and JS: --> <script type="text/javascript" src="js/bootstrap-multiselect.js"></script> <link rel="stylesheet" href="css/bootstrap-multiselect.css" type="text/css"/> <!-- Initialize the plugin: --> <script type="text/javascript"> $(document).ready(function() { $('#example-getting-started').multiselect(); }); </script></asp:Content>
1 回答
繁星淼淼
TA贡献1775条经验 获得超11个赞
您需要将 id 从 更改example-getting-started为ListBox1
<script type="text/javascript">
$(document).ready(function() {
$('#ListBox1').multiselect();
});
</script>
添加回答
举报
0/150
提交
取消