Thanks Dave. As far as I can tell the only way is to call a child-action using Html.Action.
Ideally I'd like to avoid using inline code inside the View, but I don't think that is possible with the Macro View Partial.
For reference, I checked the core source-code for PartialViewMacroEngine, which calls its own controller (PartialViewMacroController) ... which suggests that it might be possible (someday) to have custom controllers for Macro View Partials.
Can you use an MVC Controller with Macro?
Is it possible to use an MVC controller (either regular MVC or SurfaceController) with a Macro View Partial?
My initial check found that it wasn't possible, but I'm curious if others have figured out a way to achieve this?
Thanks,
- Lee
What I usually do is create a macro view partial and call my surface controller action from that.
See this example :
Dave
Thanks Dave. As far as I can tell the only way is to call a child-action using
Html.Action
.Ideally I'd like to avoid using inline code inside the View, but I don't think that is possible with the Macro View Partial.
For reference, I checked the core source-code for
PartialViewMacroEngine
, which calls its own controller (PartialViewMacroController
) ... which suggests that it might be possible (someday) to have custom controllers for Macro View Partials.Food for thought :-)
Thanks again!
Cheers,
- Lee
is working on a reply...