Copied to clipboard

Flag this post as spam?

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


  • Rik Helsen 670 posts 873 karma points
    Dec 14, 2009 @ 14:38
    Rik Helsen
    0

    how would you call a ascx based macro from within xslt?

    I'm looking for the best-practice for displaying a number of macro's (ascx based) conditionally...

    so my datatype has some properties:

    "showpoll"
    "showlatestsposts",

    and depening on them i need to call ascx based macro's from within an xslt ..

    how is this done?

     

    Kind regards,

    Rik

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Dec 14, 2009 @ 15:47
    Ismail Mayat
    0

    Rik,

    You can call xslt macro from xslt but not .net macro.  You may need to refactor your code and put the condition in the template using .net then you could selectively show a macro depending on your condition.

    Regards

    Ismail

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Dec 15, 2009 @ 00:02
    Douglas Robar
    0

    Ismail is right, xslt macros can't call .net macros.

    But... could you turn your .net macros into functions within an xslt extension (they're easy to make)? Then you could use an xslt macro for the 'outer' logic and the functions from your xslt extension to execute the code that you now have in .ascx macros. Make sense?

    cheers,
    doug.

Please Sign in or register to post replies

Write your reply to:

Draft