Bootstrap dropdown menu does not work in asp.net site

2

I have a page index.html that the dropdown menu feature works normally, but when I migrated to stopped working.

I'm using a page Default.aspx that inherits from masterpage.master .

<div class="btn-group pull-right">
    <a href="Default.aspx" class="btn btn-primary">Home</a>
    <div class="btn-group">
        <a href="QuemSomos.aspx" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">Quem Somos</a>
        <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
            <span class="caret"></span>   
        </button>

        <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
            <li><a href="#">Certificações</a></li>
            <li><a href="#">Alianças Estratégicas</a></li>
        </ul>
    </div>
</div>
    
asked by anonymous 27.02.2014 / 15:35

3 answers

2

Speak, face.

  • Make sure jQuery is being loaded;
  • Make sure bootstrap.js is being loaded;
  • Make sure that no javascript error occurs that prevents the dropdown from being enabled;
  • Assuming the problem is not one of the above:

  • Try to enable toggle dropdown manually in the document.ready event.
  •     <script type="text/javascript">
            $(document).ready(function(){
                $('.dropdown-toggle').dropdown();
            })
        </script>
    
        
    27.02.2014 / 15:47
    1

    From what I saw the code works normally.

    link

    Make sure that, in addition to what has already been cited by Alan R., that Jquery is also being loaded even before Bootstrap itself.

        
    27.02.2014 / 18:36
    0

    Hello! I had the same problem in my layout, when using the Google chromer inspector to check if I had any errors in my code, I was informed the version I was using from jquery was not compatible, which I should use from version of jquery 1.9.1 onwards , I have changed and my problem has been solved, I hope to help.

        
    08.02.2016 / 00:21