Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding new Theme to ASP.Net MVC 5 dont work

I have the following Problem. When i try to add a new Theme to ASP.Net MVC 5 my Navbar get crashed. When i use the Standard Bootstrap it works. I have no idea why it dont work.

This is my BundleConfig:

bundles.Add(new StyleBundle("~/Content/css").Include(
                  "~/Content/bootstrap-lumen.css",
                  "~/Content/site.css"));

This is the Standard MVC _Layout.cshtml Page:

<div 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="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            @Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li>@Html.ActionLink("Home", "Index", "Home")</li>
                <li>@Html.ActionLink("About", "About", "Home")</li>
                <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
            </ul>
            @Html.Partial("_LoginPartial")
        </div>
    </div>
</div>

This is the result when i use the normal Bootstrap:

Correct Navbar

This is the result when i try to run with Lumen Theme

enter image description here

Can someone help me? In other projects it works all the time correct i have no idea whats going wrong.

like image 353
Darem Avatar asked Jan 28 '18 15:01

Darem


2 Answers

This is because Lumen uses Bootstrap 4. Your issue with the navigation is a known breaking change.

Your options are to either use a Bootstrap 3 theme or perform a migration to version 4.

like image 136
IrishChieftain Avatar answered Sep 25 '22 01:09

IrishChieftain


You can download version 3 by changing version number in the URL:

  • Version 3: https://bootswatch.com/3/lumen/bootstrap.css
  • Version 4: https://bootswatch.com/4/lumen/bootstrap.css
like image 23
Jorge Avatar answered Sep 25 '22 01:09

Jorge