バンドルを使用してリクエストの読み込み時間を改善することができます。
App_Start
フォルダにバンドルクラスを追加し、すべてJs
ファイルを次のように追加します。
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new StyleBundle("~/Content/trans/css").Include(
"~/Content/bootstrap_min.css",
"~/Content/Theme/Css/style.css",
));
bundles.Add(new JsBundle("~/Content/themes/base/css").Include(
"~/Content/themes/base/jquery.ui.core.js",
"~/Content/themes/base/jquery.ui.resizable.js",
"~/Content/themes/base/jquery.ui.selectable.js",
"~/Content/themes/base/jquery.ui.accordion.js",
"~/Content/themes/base/jquery.ui.autocomplete.js",
"~/Content/themes/base/jquery.ui.button.js",
"~/Content/themes/base/jquery.ui.dialog.js",
"~/Content/themes/base/jquery.ui.slider.js",
"~/Content/themes/base/jquery.ui.tabs.js",
"~/Content/themes/base/jquery.ui.datepicker.js",
"~/Content/themes/base/jquery.ui.progressbar.js",
"~/Content/themes/base/jquery.ui.theme.js"));
}
}
}
Global.asax
にバンドルを登録してください。
BundleConfig.RegisterBundles(BundleTable.Bundles);
そして、それを使用するには、ビューページ(_Layout.cshtml
)あなたもCSS
ファイルをバンドルすることができ
@Scripts.Render("~/bundles/JsBundle")
同じようにバンドルJS。
これがあなたを手伝ってくれることを願っています!
バンドルと小型化について知っていますか? [ここをクリック](http://www.asp.net/mvc/overview/performance/bundling-and-minification) –