You must Sign In to post a response.
  • Category: ASP.NET

    Why not dropdownlist displaying item on clik

    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>
  • #768604
    Hi,

    I feel there is issue in the Multiselect function, can you first try out the single selection functionality.
    Use below code


    $(function(){
    $('#ddl').click(function(){
    $('body').append('<select name="LIVINGSTYLE" id="test">'+
    '<option value="1">Option 1</option>'+
    '<option value="2">Option 2</option>'+
    '<option value="3">Option 3</option>'+
    '<option value="4">Option 4</option>'+
    '</select>');
    });
    });

    Thanks,
    Mani


Sign In to post your comments