Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andreas Iseli 150 posts 427 karma points
    Feb 17, 2013 @ 18:58
    Andreas Iseli
    0

    (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.

     

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Feb 18, 2013 @ 13:05
    Jeroen Breuer
    0

    Perhaps this is a bug. Might be good to report it here: http://issues.umbraco.org/dashboard#newissue=yes

    Jeroen

  • Andreas Iseli 150 posts 427 karma points
    Feb 18, 2013 @ 13:47
    Andreas Iseli
    0

    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

  • Andreas Iseli 150 posts 427 karma points
    Feb 18, 2013 @ 14:07
    Andreas Iseli
    0

    I've posted a feature request now:

    http://issues.umbraco.org/issue/U4-1730

    Andreas

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies