locked
getting confused with bootstrap versions after using datetimepicker v4.17.45 RRS feed

  • Question

  • User439135325 posted

    my _layout file is as follows, please help me.

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - StaffExplorer</title>
    <environment include="Development">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
    <link rel="stylesheet" href="~/css/site.css" />
    </environment>
    <environment exclude="Development">
    <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css"
    asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
    asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
    <link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
    </environment>
    <style>
    table.table th {
    background-color: #808080;
    color: white
    }
    .jumbotron {
    background-size: 100% 100%;
    }
    .navbar-nav > li > a, .navbar-brand, .navbar-nav {
    padding-top: 5px !important;
    padding-bottom: 0 !important;
    height: 30px;
    }
    .navbar {
    min-height: 32px !important
    }
    </style>
    </head>
    <body>
    <nav class="navbar navbar-inverse 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="sr-only">Toggle navigation</span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    </button>
    <a asp-area="" asp-controller="Home" asp-action="Index" class="navbar-brand">StaffExplorer</a>
    </div>
    <div class="collapse navbar-collapse" id="navbarsExampleDefault">
    <ul class="navbar-nav mr-auto">
    <li class="nav-item">
    @if (User.IsInRole("Admin"))
    {
    <a asp-area="" asp-controller="User" asp-action="Index">Admin</a>
    <a asp-area="" asp-controller="Departments" asp-action="Index">Department</a>
    }
    </li>
    <li class="nav-item dropdown">
    <a class="nav-link dropdown-toggle" href="http://example.com" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Staff Menu</a>
    <div class="dropdown-menu" aria-labelledby="dropdown01">
    <a asp-area="" asp-controller="Staffs" asp-action="Index">Staff</a>
    <a asp-area="" asp-controller="Certificates" asp-action="Index">Certificate</a>
    <a asp-area="" asp-controller="Experiences" asp-action="Index">Experience</a>
    <a asp-area="" asp-controller="Papers" asp-action="Index">Paper</a>
    <a asp-area="" asp-controller="Personals" asp-action="Index">Personal</a>
    <a asp-area="" asp-controller="Qualifications" asp-action="Index">Qualification</a>
    <a asp-area="" asp-controller="ResProjs" asp-action="Index">Research/Project</a>
    <a asp-area="" asp-controller="Salarys" asp-action="Index">Salary</a>
    </div>
    </li>
    <li class="nav-item">
    <a asp-area="" asp-controller="Reports" asp-action="Index">Reports</a>
    </li>
    </ul>
    </div>
    @await Html.PartialAsync("_LoginPartial")
    </div>
    </nav>
    <div class="container body-content">
    @RenderBody()
    <hr />
    <footer>
    <p>&copy; 2018 - StaffExplorer</p>
    </footer>
    </div>
    <environment include="Development">
    <script src="~/lib/jquery/dist/jquery.js"></script>
    <script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
    <script src="~/js/site.js" asp-append-version="true"></script>
    </environment>
    <environment exclude="Development">
    <script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js"
    asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
    asp-fallback-test="window.jQuery"
    crossorigin="anonymous"
    integrity="sha384-K+ctZQ+LL8q6tP7I94W+qzQsfRV2a+AfHIi9k8z8l9ggpc8X+Ytst4yBo/hH+8Fk">
    </script>
    <script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js"
    asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
    asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
    crossorigin="anonymous"
    integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa">
    </script>
    <script src="~/js/site.min.js" asp-append-version="true"></script>
    </environment>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/js/bootstrap.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.45/js/bootstrap-datetimepicker.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.45/css/bootstrap-datetimepicker.min.css">
    <script type="text/javascript">
    $(function () {
    $('#datetimepicker1').datetimepicker();
    });
    $(function () {
    $('#datetimepicker2').datetimepicker();
    });
    </script>
    @RenderSection("Scripts", required: false)
    </body>
    </html>

    Friday, August 3, 2018 4:02 AM

All replies

  • User-474980206 posted
    You are including jQuery and bootstrap multiple times and different versions. You can only include one of each.
    Friday, August 3, 2018 3:04 PM
  • User1724605321 posted

    Hi malathip ,

    And what is the expected behavior you are looking for ? The template is using the bootstrap 4 :

    https://getbootstrap.com/docs/4.0/migration/ 

    Please confirm which bootstrap version you want to use and avoid loading multiple Jquery/bootstrap files.

    Best Regards,

    Nan Yu

    Monday, August 6, 2018 2:24 AM