1

我试图bundleConfig为 mvc4 项目添加 Bootstrap 样式表,但是当我查看我的源代码时该样式表无法呈现,所以我遇到了设计问题。我的代码如下:

   <link rel="stylesheet" href="assets/plugins/bootstrap/css/bootstrap.min.css"> 
   <script type="text/javascript" src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>  
  <script type="text/javascript" src="assets/js/jquery-1.8.2.min.js"></script>

我的 bundleConfig 代码如下

公共静态无效RegisterBundles(BundleCollection捆绑)

    {
        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                    "~/Scripts/jquery-{version}.js"));

        bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                    "~/Scripts/jquery-ui-{version}.js"));

        bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                    "~/Scripts/jquery.unobtrusive*",
                    "~/Scripts/jquery.validate*"));

        // Use the development version of Modernizr to develop with and learn from. Then, when you're
        // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
        bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                    "~/Scripts/modernizr-*"));
        bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
        bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                    "~/Content/themes/base/jquery.ui.core.css",
                    "~/Content/themes/base/jquery.ui.resizable.css",
                    "~/Content/themes/base/jquery.ui.selectable.css",
                    "~/Content/themes/base/jquery.ui.accordion.css",
                    "~/Content/themes/base/jquery.ui.autocomplete.css",
                    "~/Content/themes/base/jquery.ui.button.css",
                    "~/Content/themes/base/jquery.ui.dialog.css",
                    "~/Content/themes/base/jquery.ui.slider.css",
                    "~/Content/themes/base/jquery.ui.tabs.css",
                    "~/Content/themes/base/jquery.ui.datepicker.css",
                    "~/Content/themes/base/jquery.ui.progressbar.css",
                    "~/Content/themes/base/jquery.ui.theme.css",
                    "~/assets/plugins/bootstrap/css/bootstrap.min.css" ));
        bundles.Add(new StyleBundle("~/assets").Include(
                                "~/assets/css/headers/header1.css",
                                "~/assets/plugins/bootstrap/css/bootstrap-responsive.min.css",
                                "~/assets/css/style_responsive.css",
                                "~/assets/plugins/font-awesome/css/font-awesome.css",
                                "~/assets/plugins/parallax-slider/css/parallax-slider.css",
                                "~/assets/style.css"));
        BundleTable.EnableOptimizations = true;
          }

请你帮助我好吗?

4

1 回答 1

1

默认情况下,缩小的脚本被忽略。所以你有两个选择:

  1. 从引导 css 文件名中删除 .min。
  2. 清除 IgnoreList。

做其中之一就足够了。

于 2013-08-26T15:04:47.133 回答