Copied to clipboard

Flag this post as spam?

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


  • All Blonde 86 posts 138 karma points
    Jan 04, 2013 @ 18:46
    All Blonde
    0

    How I can get params from MACRO to custom build control

    Hi guys, please do not bite my head of, I still just learning. Here is a problem. I have following on my template:

                    <umbraco:Macro category="Manager" city="Lincoln" state="RI" Alias="Macroinsidemacrotest" runat="server"></umbraco:Macro>

    How I can get those params into my control. I tried to use

    Node.GetCurrent().GetProperty("category").Value   -- but Visual Studio say that NODE element does not exists. And I do not blame it since as far as I know NODE belongs to XML and as far as VS concern I am not reading any XML in my ASCX. I just need to get those 3 parameters (in bold) into my control. 
    Can anybody clear this for me?
    Thanks

     

  • Nigel Wilson 944 posts 2076 karma points
    Jan 04, 2013 @ 19:29
    Nigel Wilson
    100

    Hi All Blonde

    Node is valid to retrieve properties of the current page you are viewing, however this is not the way to retrieve a parameter from your MACRO.

    There is an Umbraco Free Video that outlines how to pass a value in from a MACRO to a user control and display on the page.

    Hope this gets you moving forward.

    Cheers, Nigel

     

  • All Blonde 86 posts 138 karma points
    Jan 07, 2013 @ 15:59
    All Blonde
    0

    Thank you Nigel,

    that was exactly what I needed.

    problem solved.

Please Sign in or register to post replies

Write your reply to:

Draft