Adding new Theme to ASP.Net MVC 5 dont work

社会主义新天地 提交于 2019-12-10 23:07:29

问题


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:

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

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


回答1:


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.




回答2:


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


来源:https://stackoverflow.com/questions/48488214/adding-new-theme-to-asp-net-mvc-5-dont-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!