public static IHtmlString RequireScript(this HtmlHelper html, Func <object, HelperResult> script) { var helperResult = new HelperResult(writer => script(null).WriteTo(writer)).ToString(); var a = new AssetManager.Asset(helperResult, AssetManager.AssetType.Script); AssetManager.GetInstance(html.ViewContext.HttpContext).Require(a, false); return(new MvcHtmlString("")); }
public static IHtmlString RequireStyleBundles(this HtmlHelper html, params string[] bundles) { foreach (var bundle in bundles) { var a = new AssetManager.Asset(bundle, AssetManager.AssetType.StyleBundle); AssetManager.GetInstance(html.ViewContext.HttpContext).Require(a, false); } return(new MvcHtmlString("")); }
public static IHtmlString RequireStyleForLayout(this HtmlHelper html, Func<object, HelperResult> style) { var helperResult = new HelperResult(writer => style(null).WriteTo(writer)).ToString(); var a = new AssetManager.Asset(helperResult, AssetManager.AssetType.Style); AssetManager.GetInstance(html.ViewContext.HttpContext).Require(a, true); return new MvcHtmlString(""); }
public static IHtmlString RequireStyleBundlesForLayout(this HtmlHelper html, params string[] bundles) { foreach (var bundle in bundles) { var a = new AssetManager.Asset(bundle, AssetManager.AssetType.StyleBundle); AssetManager.GetInstance(html.ViewContext.HttpContext).Require(a, true); } return new MvcHtmlString(""); }