Copied to clipboard

Flag this post as spam?

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


  • Mohamed Besher El Said 39 posts 258 karma points
    Sep 24, 2014 @ 16:29
    Mohamed Besher  El Said
    0

    Pass parameter to Macro

    i want to pass parameter to macro .I pass paramter like that 

    var id = Parameter.nodeid;
    I have Parameter class in my code which conflict with umbraco code 
    what is namespace with contain parameter to add to solve this conflict????
  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Sep 24, 2014 @ 18:03
    Dennis Aaen
    100

    Hi Mohamed,

    Try to call your parameter like this instead:

    var id = Model.MacroParameters["nodeid"]

    The code you have found, is for passing a parameter in the old legacy razor called DynamicNode, and this razor code is deprecated.

    In a MVC View/Partial View or a Partial View Macro, you can pass a parameter to your marco like the code above.

    Hope this helps,

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft