向ASP.Net MVC 5添加新主题无法正常工作 [英] Adding new Theme to ASP.Net MVC 5 dont work
问题描述
我有以下问题.当我尝试向ASP.Net MVC 5添加新主题时,导航栏崩溃.当我使用标准引导程序时,它可以工作.我不知道为什么它不起作用.
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.
这是我的BundleConfig:
This is my BundleConfig:
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap-lumen.css",
"~/Content/site.css"));
这是标准MVC _Layout.cshtml页面:
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>
这是我使用普通Bootstrap时的结果:
This is the result when i use the normal Bootstrap:
这是我尝试使用Lumen Theme运行时的结果
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.
推荐答案
这是因为 Lumen 使用Bootstrap4.您的导航问题是已知的重大更改
This is because Lumen uses Bootstrap 4. Your issue with the navigation is a known breaking change.
您的选择是使用Bootstrap 3主题或执行迁移到版本4.
Your options are to either use a Bootstrap 3 theme or perform a migration to version 4.
这篇关于向ASP.Net MVC 5添加新主题无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!