Copied to clipboard

Flag this post as spam?

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


  • Kim Larsen 29 posts 72 karma points
    Dec 12, 2010 @ 11:28
    Kim Larsen
    0

    .NET User Control macro to be used in XSLT

    I have created a simple .NET User Contro macro - actually it contains absolutely nothing at the moment - and I need to place in an XSLT macro but no matter how I try to implement the macro in my XSLT the entire website crashes the moment i save my XSLT-document. When the site is back online the XSLT is not saved but instead a new tempory XSLT-file is created.

    Is it not possible to put a .NET macro inside an XSLT document (I know that it is possible to put an XSLT macro inside an XSLT document) or what am I doing wrong in my current code;

    <xsl:variable name="macro">
      <![CDATA[<?UMBRACO_MACRO macroAlias="mTestUserControl" runat="server"></?UMBRACO_MACRO>]]>
    </xsl:variable>
    <xsl:value-of select="umbraco.library:RenderMacroContent($macro, $currentPage/@id)" disable-output-escaping="yes"/>

    Also, when the User Control is done I need to pass some parameters to it but how?

  • Kim Andersen 1447 posts 2196 karma points MVP
    Dec 12, 2010 @ 12:44
    Kim Andersen
    0

    Hi Kim

    As far as I know, you can't use a .NET macro inside a XSLT file. It simply doesn't work.

    In this post others have the same opinion.

    /Kim A

  • Kim Larsen 29 posts 72 karma points
    Dec 12, 2010 @ 13:22
    Kim Larsen
    0

    Ok - but is it instead possible to send some page-specific variables to the macro if i place the macro in my template? When working with XSLT I have easy access to the variables of the current page (this is why i tried to place the .NET macro inside the XSLT) but what if I place it in the template instead?

  • Kim Larsen 29 posts 72 karma points
    Dec 12, 2010 @ 13:41
    Kim Larsen
    0

    nevermind - solved :)

    Tnx for your reply!

Please Sign in or register to post replies

Write your reply to:

Draft