Note that there are some explanatory texts on larger screens.

plurals
  1. POUmbraco inline razor @section in head tag
    primarykey
    data
    text
    <p>I'm trying to create razor @section in one of my views, using umbraco:Macro tag, in order to add scripts/styles specific for each view into head tag. My current code looks like this(head section of master page):</p> <pre><code>&lt;asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server"&gt; &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8" /&gt; &lt;meta name="viewport" content="width=device-width" /&gt; &lt;link rel="stylesheet" type="text/css" href="/css/foundation.min.css"&gt; &lt;script type="text/javascript" src="/js/jquery-1.10.1.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/js/responsiveslides.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/js/js.js"&gt;&lt;/script&gt; &lt;umbraco:Macro runat="server" language="cshtml"&gt; @if(IsSectionDefined("JSIncludes")) { @RenderSection("JSIncludes") } @if(IsSectionDefined("CSSIncludes")) { @RenderSection("CSSIncludes") } &lt;/umbraco:Macro&gt; &lt;/head&gt; </code></pre> <p>and this(actual section in view):</p> <pre><code>&lt;asp:Content ContentPlaceHolderId="ContentPlaceHolderDefault" runat="server"&gt; &lt;umbraco:Macro runat="server" language="cshtml"&gt; @section JSIncludes { &lt;script type="text/javascript" src="/js/main_page.js"&gt;&lt;/script&gt; } &lt;/umbraco:Macro&gt; </code></pre> <p>But when i'm trying to open a page, i'm getting "Error loading MacroEngine script (file: )" error on top of my page. Do anyone know the reason of this? Would be great, if somebody knew how to add things like this properly. Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload