Copied to clipboard

Flag this post as spam?

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


  • JL 5 posts 25 karma points
    Jul 16, 2010 @ 22:38
    JL
    0

    Macro parameter value not being passed

    Hi,

    I have a macro that accepts two parameters which represent the nodeID of my content nodes.

    I am prompted to enter values for these parameters when I add the macro to my template.

    I know these nodes exist (they are non-zero values) but when I try to view my page I get the error:

     

    No node exists with id '0'

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentException: No node exists with id '0'

     

    What could be wrong?

  • Sascha Wolter 615 posts 1101 karma points
    Jul 16, 2010 @ 23:17
    Sascha Wolter
    0

    Hi JL,

    are you talking about a XSLT or a .Net macro? Can you please post a bit of your code, especially when you read the parsed in value and what exactly you are doing when the exception gets thrown?

    Sometimes I run into a bit trouble with macro parameters as well, don't know if it's a caching issue or if some alias names are reserved (e.g. 'text'). What I usually do is add another parameter with an alias like 'myParameter1' which is just of type text and see if it gets through by doing just this:

    <xsl:param name="myParameter1" source="/macro/myParameter1" />

    <xsl:template match="/">

    <xsl:value-of select="$myParameter1" />

    </xsl:template>

    Cheers,

    Sascha

Please Sign in or register to post replies

Write your reply to:

Draft