Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 952 karma points
    Nov 25, 2011 @ 04:28
    Tom
    0

    using razor inside a user control macro?

    can you use razor in a user control macro?

    I wanted to get access to some properties etc

     

    Cheers,

    Tom

  • Dan Diplo 1505 posts 5911 karma points MVP 4x c-trib
    Nov 25, 2011 @ 17:33
    Dan Diplo
    2

    You can't use razor syntax but you can get acess to a DynamicNode instance, which is equivalent to your "Model" from which you can access your page properties:

    dynamic model = new umbraco.MacroEngines.DynamicNode(umbraco.NodeFactory.Node.GetCurrent());
    string name = model.Name;

     

  • Tom 713 posts 952 karma points
    Nov 27, 2011 @ 23:32
    Tom
    0

    Thanks Dan! just what I was looking for! :)

  • 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