Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all,
After upgrading my Umbraco from v6 to v7 all inline razor script macros are broken, independent on what the content is, for example this dummy macro:
<umbraco:Macro runat="server" Language="razor"> @{ var href = "index.htm"; <a href="@href">Home</a> } </umbraco:Macro>
The error:
Error loading MacroEngine script (file: )
Does somebody know a solution for this?
Hi Corné
Are you running in MVC mode then try to do like this.
@{ var href = "index.htm"; <a href="@href">Home</a> }
Hope this helps,
/Dennis
In umbracoSettings.config the render mode is set to MVC:
<defaultRenderingEngine>Mvc</defaultRenderingEngine>
Then, my macro is inside an old school contentplaceholder:
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"> </asp:Content>
When i remove the <umbraco:Macro runat="server" Language="razor"> the Razor is outputted as HTML instead of that it is rendered as Razor.
<umbraco:Macro runat="server" Language="razor">
Hi Corné,
Okay so you are using MVC, what you need to do then is convert the old Master templates to MVC views.
Try to see this cheatsheet on how.
https://our.umbraco.org/documentation/Cheatsheets/masterpagestoviews
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Inline Razor Macros in templates not working
Hi all,
After upgrading my Umbraco from v6 to v7 all inline razor script macros are broken, independent on what the content is, for example this dummy macro:
The error:
Does somebody know a solution for this?
Hi Corné
Are you running in MVC mode then try to do like this.
Hope this helps,
/Dennis
In umbracoSettings.config the render mode is set to MVC:
Then, my macro is inside an old school contentplaceholder:
When i remove the
<umbraco:Macro runat="server" Language="razor">
the Razor is outputted as HTML instead of that it is rendered as Razor.Hi Corné,
Okay so you are using MVC, what you need to do then is convert the old Master templates to MVC views.
Try to see this cheatsheet on how.
https://our.umbraco.org/documentation/Cheatsheets/masterpagestoviews
Hope this helps,
/Dennis
is working on a reply...