Dropdown menu from Bootstrap in asp.net site only works on the main page, what can I do to fix it?

2

The dropdown menu apparently works on the main page, but when I'm on another page and I'm going to use it it does not work! I already checked if the HTML code is generating with jQuery and I did not see anything strange. What to do?

<body>
   <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
       <div class="container">
           <div class="navbar-header">

               <a class="navbar-brand" href="#">sis</a>
           </div>
           <div class="collapse navbar-collapse">
               <ul class="nav navbar-nav">

                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Cadastros<b class="caret"></b></a>
                        <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
                            <li><a href="PessoasFisica/frmConPessoaFisica.aspx">Consulta de Pessoa Fisica</a></li>
                </ul>
           </div>
        </div>
    </nav>   
    <script src="Scripts/jquery-2.1.4.js"></script>
    <script src="Scripts/jquery-2.1.4.min.js"></script>
    <script src="Scripts/bootstrap.js"></script>
    <script src="Scripts/bootstrap.min.js"></script>
    <script> $(document).ready(function () { $('.dropdown-toggle').dropdown(); }); </script>

</body>
    
asked by anonymous 17.06.2015 / 04:29

1 answer

2

You do not need to jquery activation of dropdown unless you want to use some event in conjunction with the click or something else - only with formatting you can put it to work. Also remove the% unnecessary external%:

link

 <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
       <div class="container">
           <div class="navbar-header">
            <a class="navbar-brand" href="#">sis</a>
           </div>
          <div class="collapse navbar-collapse">
      <ul class="nav navbar-nav">

        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Cadastro <span class="caret"></span></a>
          <ul class="dropdown-menu">
             <li><a href="PessoasFisica/frmConPessoaFisica.aspx">Consulta de Pessoa Fisica</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
          </ul>
        </li>
      </ul>
           </div>
        </div>
    </nav> 
<script src="Scripts/jquery-2.1.4.min.js"></script>
<script src="Scripts/bootstrap.min.js"></script>  
    
17.06.2015 / 19:44