2013-08-16 42 views
1

我試圖穿上mdc4項目bundleConfig Bootstrap樣式表,但該樣式表無法呈現當我查看我的源,所以我得到設計的問題。我的代碼如下:引導樣式表無法呈現時,將樣式表放在MVC4的bundleConfig

<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; 
      } 

你能幫幫我嗎?

+0

請添加你的bundleCongif的代碼 –

+0

有一個問題,是jQuery需要加載之前bootstrap.min.js – Schmalzy

+0

helo ElvinArzumanoğlu,我已經添加我的bundleCongif的代碼 – Sajith

回答

1

默認情況下,縮小的腳本將被忽略。所以你有兩種選擇:

  1. 從bootstrap css文件名刪除.min。
  2. 清除忽略列表。

做這些應該就夠了。