2017-03-14 68 views
0

我正在使用ASP.NET創建演示站點。只是想知道爲什麼我的bootstrap css不能在我的生產服務器上工作。它在我的開發電腦中工作正常。我已經上傳了所有的內容文件夾和bootstrap.css。Bootstrap css在生產服務器上不工作

下面是我bundleconfig.vb

Public Module BundleConfig 
' For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkID=303951 
Public Sub RegisterBundles(bundles As BundleCollection) 
    bundles.Add(New ScriptBundle("~/bundles/WebFormsJs").Include(
     "~/Scripts/WebForms/WebForms.js", 
     "~/Scripts/WebForms/WebUIValidation.js", 
     "~/Scripts/WebForms/MenuStandards.js", 
     "~/Scripts/WebForms/Focus.js", "~/Scripts/WebForms/GridView.js", 
     "~/Scripts/WebForms/DetailsView.js", 
     "~/Scripts/WebForms/TreeView.js", 
     "~/Scripts/WebForms/WebParts.js")) 

    ' Order is very important for these files to work, they have explicit dependencies 
    bundles.Add(New ScriptBundle("~/bundles/MsAjaxJs").Include(
     "~/Scripts/WebForms/MsAjax/MicrosoftAjax.js", 
     "~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js", 
     "~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js", 
     "~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js")) 

    ' 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-*")) 

    ScriptManager.ScriptResourceMapping.AddDefinition("respond", New ScriptResourceDefinition() With { 
     .Path = "~/Scripts/respond.min.js", 
     .DebugPath = "~/Scripts/respond.js"}) 

End Sub 

前端模塊

如何進一步解決?

問候, 史蒂夫

+0

控制檯中是否有錯誤?你的css文件是否可以在同一個URL下訪問? – Monicka

+0

是的,我同意SimonaMi ..你只需要檢查你的引導CSS和JS文件網絡路徑..並檢查內容是否可訪問。 –

+0

嗨,我沒有看到我的控制檯中的任何錯誤。 – Steve

回答

0

在工具Visual Studio中的下拉菜單,選擇NuGet包管理器 - >管理的NuGet包解決方案。然後搜索,選擇並安裝最新(v3 +)版本的Bootstrap。這會自動在您的項目空間中正確設置它。

看起來有人在項目中手動安裝它,然後從未對Bundling類進行必要的更改。在DEBUG模式下,縮小和捆綁的類將被忽略。但是,在RELEASE模式下,與部署時一樣,只有Bundling類中的文件才被引用,除非在頁面的頭部指定了其他文件。

+0

嗨,我正在使用網站項目,而不是Web應用程序項目。 – Steve

+0

我不熟悉網站模板,但Nuget也應該這樣做。嘗試一下(先回到你的項目)? – IrishChieftain

相關問題