Adding new Theme to ASP.Net MVC 5 dont work

2019-08-15 21:04发布

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.

2条回答
我想做一个坏孩纸
2楼-- · 2019-08-15 21:28

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

查看更多
萌系小妹纸
3楼-- · 2019-08-15 21:29

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.

查看更多
登录 后发表回答