Bootstrap selectpicker javascript函数在asp。
中无效Javascript代码:
<script type="text/javascript">
$(document).ready(function () {
$('.selectpicker').selectpicker();
});
</script>
Asp代码:
<asp:DropDownList ID="DropDownList2" CssClass="selectpicker" data-style="btn-danger" runat="server">
<asp:ListItem>Action</asp:ListItem>
<asp:ListItem>Another action</asp:ListItem>
<asp:ListItem>Something else here</asp:ListItem>
</asp:DropDownList>
答案 0 :(得分:1)
使用$('.dropdown-toggle').dropdown();