Exemplo n.º 1
0
        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(""));
        }
Exemplo n.º 2
0
 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(""));
 }
Exemplo n.º 3
0
 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("");
 }
Exemplo n.º 4
0
 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("");
 }