protected IHtmlString JsInline(Func <dynamic, HelperResult> jsFragmentRenderer) { string html = jsFragmentRenderer(null).ToHtmlString(); Bundles.AddInlineScript(html, "inline"); return(MvcHtmlString.Empty); }
public void AddInlineScriptAddsReferenceToInlineScriptBundle() { Bundles.AddInlineScript("content", "location"); referenceBuilder.Verify(b => b.Reference(It.Is <Bundle>(bundle => bundle is InlineScriptBundle), "location")); }