![](/img/trans.png)
[英]Is there a way to prevent some variables being renamed via asp.net System.Web.Optimization
[英]ASP.NET System.Web.Optimization: Bundling jQueryUI CSS
我試圖在一個請求中捆綁jQueryUI。
Global.asax中:
var cssjQuery = new StyleBundle("~/Content/BundleCSS/jQuery");
cssjQuery.IncludeDirectory("~/Content/themes/base", "*.css");
布局:
<link href="@Styles.Url("~/Content/BundleCSS/jQuery")" rel="stylesheet" type="text/css" />
文件夾結構:
現在的問題是無法加載圖像,因為沒有文件夾“BundleCSS”:
http://localhost:64648/Content/BundleCSS/images/ui-bg_flat_75_ffffff_40x100.png
我該如何解決這個問題?
為什么不在主題目錄路徑上簡單地定義捆綁包:
var cssjQuery = new StyleBundle("~/Content/themes/base/jquery-ui-bundle");
cssjQuery.IncludeDirectory("~/Content/themes/base", "*.css");
相對圖像路徑仍然有效(因為CSS的目錄將保持不變)。
另請注意,最后一部分( jquery-ui-bundle
)被視為文件名,因此它可以是您想要的任何內容(只要它與其中一個文件不同)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.