Example #1
0
        protected IHtmlString JsInline(Func <dynamic, HelperResult> jsFragmentRenderer)
        {
            string html = jsFragmentRenderer(null).ToHtmlString();

            Bundles.AddInlineScript(html, "inline");

            return(MvcHtmlString.Empty);
        }
Example #2
0
 public void AddInlineScriptAddsReferenceToInlineScriptBundle()
 {
     Bundles.AddInlineScript("content", "location");
     referenceBuilder.Verify(b => b.Reference(It.Is <Bundle>(bundle => bundle is InlineScriptBundle), "location"));
 }