@Styles.Render @Scripts.Render
@Styles.Render @Scripts.Render
package .css and .js
ues @Styles.Render @Scripts.Render to reference in HTML pages.
1. App_start > BundleConfig.cs
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-1.9.1.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/Site.css"
));
}
2. put in _Layout.cshtml or xxx.html
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/jquery")
參考網址:dotblogs