We have a macro partial view that requires us to run some logic in a controller in the GET action based on query string parameters before rendering the partial view.
We have a corresponding surface controller to handle POST actions but I can't figure out how to hook into the GET action in order to run the required logic on the initial request.
I've tried coding Index() and Render() methods in the surface controller but those are never executed.
Is it even possible for me to do what I'm attempting? If not I could just create a specific document type, template and partial view but we were hoping to keep this logic in a macro to make it easier on the designer.
Render controller for Macro
We have a macro partial view that requires us to run some logic in a controller in the GET action based on query string parameters before rendering the partial view.
We have a corresponding surface controller to handle POST actions but I can't figure out how to hook into the GET action in order to run the required logic on the initial request.
I've tried coding Index() and Render() methods in the surface controller but those are never executed.
Is it even possible for me to do what I'm attempting? If not I could just create a specific document type, template and partial view but we were hoping to keep this logic in a macro to make it easier on the designer.
I don't think you can achieve what you want, however there may be a way around it, what exactly do you need to do?
If you want to pass values to the macro based on the querystring, you could maybe do something like
In your MacroPartial
Controller
is working on a reply...