【问题标题】:MVC4 new bundling/minification featureMVC4 新的捆绑/缩小功能
【发布时间】:2012-01-29 12:26:10
【问题描述】:

我似乎无法在我的项目中使用新的捆绑/缩小功能。我的 _Layout.cshtml 中有这个。

 <link href="@Url.Content("~/Content/themes/" + ViewBag.SiteEntity.LayoutName + "/css/css")" rel="stylesheet" /> 

这给了我链接 href="/Content/themes/FixedLayout21/css/css" rel="stylesheet" 这是正确的路径,但它没有显示在浏览器中。有什么iodeas吗?

【问题讨论】:

  • 感谢您指出这一点。我没有在 ScottGu 的博客上看到这个。我添加了 BundleTable.Bundles.EnableDefaultBundles();它有效。

标签: css asp.net-mvc-4


【解决方案1】:

为了结束这个问题,将以下内容添加到 global.asax 的 Application_Start() 方法中。

BundleTable.Bundles.EnableDefaultBundles();

【讨论】:

  • 从 ASP.NET 4.5 开始不再需要此行
猜你喜欢
  • 2013-10-22
  • 2012-06-28
  • 1970-01-01
  • 2023-03-03
  • 1970-01-01
  • 2013-02-01
  • 1970-01-01
  • 2013-09-11
  • 1970-01-01
相关资源
最近更新 更多