Twitter bootstrap 将引导添加到布局页面不会影响在asp.net MVC 4中查看页面
我已经将引导添加到MVC4项目中,如下所示 但我的布局并不像我预期的那样。 我已将所需文件添加到上述文件夹中, 下面是我的Twitter bootstrap 将引导添加到布局页面不会影响在asp.net MVC 4中查看页面,twitter-bootstrap,asp.net-mvc-4,Twitter Bootstrap,Asp.net Mvc 4,我已经将引导添加到MVC4项目中,如下所示 但我的布局并不像我预期的那样。 我已将所需文件添加到上述文件夹中, 下面是我的BundleConfig.cs文件 bundles.IgnoreList.Clear(); bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-{version}.js")); bundles.Add(new ScriptBundl
BundleConfig.cs
文件
bundles.IgnoreList.Clear();
bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/bootstrapjs").Include("~/Scripts/bootstrap.js"));
bundles.Add(new StyleBundle("~/Content/bootstrapcss").Include("~/Content/bootstrap.css"));
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title - My ASP.NET MVC Application</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
@*<link rel="stylesheet" href="~/Content/Site.css" type="text/css" />*@
@Styles.Render("~/Content/bootstrapcss")
@*@Scripts.Render("~/bundles/modernizr")*@
</head>
<body>
<div class="container-fluid" style="background-color:azure;">
<div class="row-fluid">
<div class="span2">
<!--Sidebar content-->
@RenderSection("Sidebar", true)
</div>
<div class="span10">
<!--Body content-->
@RenderSection("MainContent", true)
</div>
</div>
</div>
@RenderBody()
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrapjs")
</body>
</html>
然后我将新页面添加为新布局,并将其命名为
UserLayout.cs
我的新布局页面如下
bundles.IgnoreList.Clear();
bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/bootstrapjs").Include("~/Scripts/bootstrap.js"));
bundles.Add(new StyleBundle("~/Content/bootstrapcss").Include("~/Content/bootstrap.css"));
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title - My ASP.NET MVC Application</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
@*<link rel="stylesheet" href="~/Content/Site.css" type="text/css" />*@
@Styles.Render("~/Content/bootstrapcss")
@*@Scripts.Render("~/bundles/modernizr")*@
</head>
<body>
<div class="container-fluid" style="background-color:azure;">
<div class="row-fluid">
<div class="span2">
<!--Sidebar content-->
@RenderSection("Sidebar", true)
</div>
<div class="span10">
<!--Body content-->
@RenderSection("MainContent", true)
</div>
</div>
</div>
@RenderBody()
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrapjs")
</body>
</html>
但当我运行应用程序时,输出与正常网页一样,没有进行格式化,
有人能帮我解决这个问题吗,。。谢谢
对不起,我的英语不好,
提前感谢,您是否包含css文件?看起来该行已注释掉了
~/Content/Site.css
Shyju,是否需要Site.cs?