I can\'t make bootstrap dropdown to work. Here is my html for nav:
- Home
-
Here what i did is .....
Just removed bootstrap.min.js from my Project and added bootstrap.js to it and it started working........
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js"
//"~/Scripts/bootstrap.min.js"));
I had the same problem. After a couple of hours of trouble shooting found that,
I had
<script type="text/javascript" src="Scripts/bootstrap.min.js"></script>
<script type="text/javascript" src="Scripts/jquery-2.1.1.min.js"></script>
instead of,
<script type="text/javascript" src="Scripts/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="Scripts/bootstrap.min.js"></script>
Hope this helps someone
I had a similar issue only to observe that i had added the bootstrap script twice and the second bootstrap script was after above the jquery script.
Solution:
For latest Bootstrap you will need Popper.js
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
Copy the link in the End of the Body section just before the <body>
Tag, inside <Head>
Tag.
I just added JS
part of bootstrap
to my index page, then it worked
Paste this, if you're using the latest version of bootstrap
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
For your style you need to include the css files of bootstrap, generally just before </head>
element
<link href="css/bootstrap.css" rel="stylesheet">
Next you'll need to include the js files, it's recommended to include them at the end of the document, generally before the </body>
so pages load faster.
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>