Ejemplo n.º 1
0
        public static HtmlString RunJavascript(this IHtmlHelper @this, JavascriptService service, PageLifecycleStage stage = PageLifecycleStage.Init)
        {
            var actions = @this.ViewContext.HttpContext.JavascriptActions();

            var exists = actions.Any(x => x is JavascriptService j && j == service);

            if (!exists)
            {
                actions.Add(service);
            }

            return(HtmlString.Empty);
        }
Ejemplo n.º 2
0
 public virtual JsonResult JavaScript(JavascriptService service)
 {
     JavascriptActions.Add(service);
     return(JsonActions());
 }