我正在使用带有 .NET Framework 4 的 MVC 3 捆绑和缩小。创建BundleConfig.cs并放在App_Data
文件夹下。从Global.asax文件中调用
。
从我调用的主文件BundleConfig.RegisterBundles(BundleTable.Bundles);
Application_Start()
<% Styles.Render("~/Content/themes/base"); %>
<% Scripts.Render("~/Scripts","~/Scripts/Controllers","~/Scripts/Views");%>
在标题标签上。
然而,CSS 未按预期呈现,jQuery 未按Scripts.Render
预期工作。
我的BundleConfig.cs类定义如下...
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new StyleBundle("~/Content/themes/base").Include(
"~/Content/themes/base/Blueprint-Liquid.css",
"~/Content/themes/base/ex.css",
"~/Content/themes/base/exNav.css",
"~/Content/themes/base/ie.css",
"~/Content/themes/base/jquery-ui-1.8.14.custom.css",
"~/Content/themes/base/jquery.qtip.css",
"~/Content/themes/base/reset.css",
"~/Content/themes/base/Site.css",
"~/Content/themes/base/structure-fixed.css",
"~/Content/themes/base/structure-fluid.css",
"~/Content/themes/base/tipsy.css",
"~/Content/themes/base/typography.css",
"~/Content/themes/base/ui.jqgrid.css")
);
bundles.Add(new ScriptBundle("~/Scripts/Controllers").Include(
"~/Scripts/Controllers/ProjectController.js",
"~/Scripts/Controllers/RequestController.js",
"~/Scripts/Controllers/SystemController.js")
);
bundles.Add(new ScriptBundle("~/Scripts/Views").Include(
"~/Scripts/Views/ProjectView.js",
"~/Scripts/Views/RequestView.js",
"~/Scripts/Views/SystemView.js")
);
bundles.Add(new ScriptBundle("~/Scripts").Include(
"~/Scripts/Dialog.js",
"~/Scripts/EX.Computing.js",
"~/Scripts/exNav.js",
"~/Scripts/grid.locale-en.js",
"~/Scripts/jquery-1.6.2.js",
"~/Scripts/jquery-1.6.2.min.js",
"~/Scripts/jquery-ui-1.8.14.js",
"~/Scripts/jquery-ui-1.8.14.min.js",
"~/Scripts/jquery.jqGrid.fluid.js",
"~/Scripts/jquery.jqGrid.min.js",
"~/Scripts/jquery.jqGrid.src.js",
"~/Scripts/jquery.qtip.js",
"~/Scripts/jquery.tipsy.js",
"~/Scripts/jquery.jquery.unobtrusive-ajax.js",
"~/Scripts/jquery.jquery.unobtrusive-ajax.min.js",
"~/Scripts/jquery.jquery.validate-vsdoc.js",
"~/Scripts/jquery.validate.js",
"~/Scripts/jquery.validate.min.js",
"~/Scripts/jquery.validate.unobtrusive.js",
"~/Scripts/jquery.validate.unobtrusive.min.js",
"~/Scripts/json2.js",
"~/Scripts/Labels.js",
"~/Scripts/modernizr-1.7.js",
"~/Scripts/SessionTimeOut.js",
"~/Scripts/underscore.js")
);
BundleTable.EnableOptimizations = true;
}
我想知道我错过了什么?非常感谢任何帮助!
谢谢, 拉马尼