why not dropdownlist displaying item on click

Posted by Cpatil1000 under ASP.NET on 12/27/2016 | Points: 10 | Views : 419 | Status : [Member] | Replies : 1
Hi,

I am working on a website in which i need to represent many items in
dropdownlist with checkboxs. for that i m using bootstrap dropdown checkbox
list. But when i click this dropdown is not opening in the asp.ent
If I try in new form then it is display but when i try to using master form
then it not geting items of dropdownlist.

<asp:Content ID="Content1" ContentPlaceHolderID="cHead" runat="Server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>
<link href="http://cdn.rawgit.com/davidstutz/bootstrap-multiselect/master/dist/css/bootstrap-multiselect.css"
rel="stylesheet" type="text/css" />
<script src="http://cdn.rawgit.com/davidstutz/bootstrap-multiselect/master/dist/js/bootstrap-multiselect.js"
type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('[id*=lstFruits]').multiselect({
includeSelectAllOption: true
});
});
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mBody" runat="Server">
<asp:ListBox ID="lstFruits" runat="server" SelectionMode="Multiple">
<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>
</asp:Content>





Responses

Posted by: Allemahesh on: 1/2/2017 [Member] [MVP] Silver | Points: 25

Up
0
Down
Remove the below code from content page and put in the Master page at the bottom.

<script type="text/javascript">
$(function () {
$('[id*=lstFruits]').multiselect({
includeSelectAllOption: true
});
});
</script>


Cpatil1000, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response