I’m trying to retro fit Bootstrap into an existing Asp.Net Web Forms project and I’m not able to get a dropdown to expand and show.

I went to NuGet and then added BootStrap 3.3.6 which is what was the default. I then downloaded the Cerulean .css files off of Bootswatch.com and replaced the bootstrap.css and bootstrap.min.css files in the Content folder. From there I copied there sample Nav and put it on the page.

The Nav bar initially looks correct with the Cerulean theme but when I tried to expand the dropdown list nothing happened. I’m going to try to use the dropdown lists for my menu so I’m trying to get that to work.

I initially had the reference to the .js files at the bottom of the page. I have since moved them to the top of the page to see if that made any difference but it didn’t.

Anyone know what I might be missing to get Bootstrap’s dropdown to work?

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="PrefBid.Site" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script src="Scripts/bootstrap.min.js"></script>
<script src="Scripts/respond.min.js"></script>
<script src="Scripts/jquery-2.1.4.min.js"></script>
<link href="Content/bootstrap.min.css" rel="stylesheet" />
<link href="Content/Site.css" rel="stylesheet" />  

    <asp:ContentPlaceHolder ID="head" runat="server">
    <form id="form1" runat="server">

    <div class="navbar navbar-default navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                <a class="navbar-brand" href="#">PBS</a>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li><a href="#">Dashboard</a></li>
                    <li class="dropdown">
                      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Dropdown <span class="caret"></span></a>
                      <ul class="dropdown-menu" role="menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                        <li class="divider"></li>
                        <li><a href="#">One more separated link</a></li>
                    <li><a href="#">Management</a></li>
                    <li><a href="#">Reports</a></li>
    <div class="container body-content">
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">




Related posts

Recent Viewed