C# 浏览器无法识别捆绑(优化)样式
我尝试在asp.NETMVC4项目中使用Bundle,当它处于调试模式时一切正常,但当我尝试使用优化模式时,发生了一些奇怪的事情 这是我的捆绑包配置:C# 浏览器无法识别捆绑(优化)样式,c#,asp.net-mvc,styles,bundle,C#,Asp.net Mvc,Styles,Bundle,我尝试在asp.NETMVC4项目中使用Bundle,当它处于调试模式时一切正常,但当我尝试使用优化模式时,发生了一些奇怪的事情 这是我的捆绑包配置: bundles.Add(new ScriptBundle("~/content/admin/css").Include("~/Content/css/AdminPage.css",
bundles.Add(new ScriptBundle("~/content/admin/css").Include("~/Content/css/AdminPage.css",
"~/Content/MarkItUp/MarkItUp.css",
"~/Content/MarkItUp/style.css",
"~/Content/jqTreeThemes/apple/style.css",
"~/Content/css/popup_window.css",
"~/Content/css/fullcalendar.css",
"~/Content/jHtmlArea/jHtmlArea.css"));
这就是我在页面上使用它的方式:
@section header
{
@Styles.Render("~/content/admin/css");
}
所以,当我使用
BundleTable.EnableOptimizations = true;
例如,Firefox以脚本的形式获得样式,我可以在FireBug的Net选项卡中看到这一点。
这就是为什么我的陈腐没有任何效果
有人能解释一下我的原因吗?不要使用脚本包来编写脚本,而要使用样式包来编写样式
bundles.Add(new StyleBundle("~/content/admin/css").Include("~/Content/css/AdminPage.css","~/Content/MarkItUp/MarkItUp.css","~/Content/MarkItUp/style.css","~/Content/jqTreeThemes/apple/style.css","~/Content/css/popup_window.css","~/Content/css/fullcalendar.css","~/Content/jHtmlArea/jHtmlArea.css"));
xD,谢谢,我在第二天早上发现了这个问题,编码过程太长了!