Unfortunately when posting back the form (I've used BeginUmbracoForm) the parameters and the macro respectively are no more available. I'm aware that I can use hidden fields or the TempData (Session) to transmit the parameters to the "SendMail" action I've created but I don't like the idea of storing the mail address in a hidden form or even in the session.
Is there a suitable way to access the macro parameters? The PartialViewMacroModel itself does not provide enought information for such a "backward" process.
Or is it even possible to implement my own macro partial view page controller? I've tried that but it seems not to be possible.
Perhaps I've written it a bit misunderstandable. I don't think it is a bug though but there is just no way to access macro parameters another way round than through the PartialViewMacroModel object. What we need is a "way back" like a specific macro ID we can access the macros parameter through the current pages (IPublishedContent) object.
(v6) Accessing Macro Parameters in Rendered Action
Hello together
I currently have a macro partial (mvc rendering) that calls a HTML action of my controller and commits two parameters to the Index Action:
@{
Html.RenderAction("Index", "ContactForm", new { mailSubject = Model.MacroParameters["mailSubject"], toMailAddress = Model.MacroParameters["mailAddress"] });
}
Unfortunately when posting back the form (I've used BeginUmbracoForm) the parameters and the macro respectively are no more available. I'm aware that I can use hidden fields or the TempData (Session) to transmit the parameters to the "SendMail" action I've created but I don't like the idea of storing the mail address in a hidden form or even in the session.
Is there a suitable way to access the macro parameters? The PartialViewMacroModel itself does not provide enought information for such a "backward" process.
Or is it even possible to implement my own macro partial view page controller? I've tried that but it seems not to be possible.
I appreciate any help. Thanks.
Perhaps this is a bug. Might be good to report it here: http://issues.umbraco.org/dashboard#newissue=yes
Jeroen
Hey Jeroen
Perhaps I've written it a bit misunderstandable. I don't think it is a bug though but there is just no way to access macro parameters another way round than through the PartialViewMacroModel object. What we need is a "way back" like a specific macro ID we can access the macros parameter through the current pages (IPublishedContent) object.
Regards
I've posted a feature request now:
http://issues.umbraco.org/issue/U4-1730
Andreas
is working on a reply...