Asp.net-Mvc-4

Kendo MVC 不顯示 Sprites.PNG 404 錯誤

  • January 20, 2017

Vs'12 網際網路應用模板 + KendoUI - MVC4 , EF Code First

  • 關注劍道文件
  • 使用kahanu 的 Awesome 文章進行了調整
  • 一切都很好,所以我<compilation debug="false" targetFramework="4.5">從真到假
  • Kendo UI 停止查找 Spites.png (by Kendo)
  • 去尋找並發現了這個(沒有解決我的問題):stackOverflow1
  • 檢查並重新檢查步驟1-2,在伺服器上尋找Sprites.png,它存在..但是在Kendo的某些子目錄中不在下面的目錄中?/

我在哪裡重新編寫程式碼並讓它在實際位置而不是這個位置尋找精靈?: GET http://cls-og.com/bundles/css/Default/sprite.png 404(未找到)

我認為您的問題出在捆綁包中,這就是為什麼它在調試(因此沒有捆綁包)但在發布模式下效果很好的原因。

我的建議是將 kendo 樣式文件夾放在 Content 上並在同一位置創建捆綁包。

例如:

BundleTable.Bundles.Add(new StyleBundle("~/Content/kendo/kendo").Include(
           "~/Content/kendo/kendo.common.min.css",
           "~/Content/kendo/kendo.dataviz.min.css",
           "~/Content/kendo/kendo.default.min.css",
           "~/Content/kendo/kendo.dataviz.default.min.css"
       ));

另一個提示:為避免將來出現捆綁問題,請將其插入 RegisterBundles 方法中:

       BundleTable.EnableOptimizations = true;

這也會在調試模式下強制捆綁!

希望這可以幫助!

祝你今天過得愉快,

阿爾貝托

引用自:https://stackoverflow.com/questions/18924545