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
How do I render a MVC Partial from a MacroPartial?
My MacroPartial (~/Views/MacroPartials/Contact.cshtml) looks like this:
@inherits Umbraco.Web.Macros.PartialViewMacroPage
<div id="contact-wrapper">
@Html.Partial("Contact")
</div>
My Contact view (~/Views/Partials/Contact.cshtml) looks like this:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
<p>Hello!</p>
--
This line causes the error: @Html.Partial("Contact")
Error loading MacroEngine script (file: ~/Views/MacroPartials/Contact.cshtml)
How do I make this work?
Have you tried @Umbraco.RenderMacro("Contact")
@Umbraco.RenderMacro("Contact")
That doesnt work.It keeps loading itself, if I ask it to load itself (obviously) - causing an infinite loop.
I would like my code to render a MVC Partial, not a Macro :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Render MVC Partial from MacroScript
How do I render a MVC Partial from a MacroPartial?
My MacroPartial (~/Views/MacroPartials/Contact.cshtml) looks like this:
@inherits Umbraco.Web.Macros.PartialViewMacroPage
<div id="contact-wrapper">
@Html.Partial("Contact")
</div>
My Contact view (~/Views/Partials/Contact.cshtml) looks like this:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
<p>Hello!</p>
--
This line causes the error: @Html.Partial("Contact")
Error loading MacroEngine script (file: ~/Views/MacroPartials/Contact.cshtml)
How do I make this work?
Have you tried
@Umbraco.RenderMacro("Contact")
That doesnt work.
It keeps loading itself, if I ask it to load itself (obviously) - causing an infinite loop.
I would like my code to render a MVC Partial, not a Macro :)
is working on a reply...