Copied to clipboard

Flag this post as spam?

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


  • rajeev 18 posts 38 karma points
    Feb 08, 2011 @ 05:46
    rajeev
    0

    can I get child node collection in C# event on a paren page?

    can I get child node collection in C# event on  a paren page? How is it possible?

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Feb 08, 2011 @ 08:22
    Sebastiaan Janssen
    0

    I don't know what your asking, what kind of event? What do you need to do with the collection?

    You can make an XSLT macro and put it in your template so that it appears on your page, for example to list the children if the current page:

    <ul>
     <xsl:for-each select="$currentPage/child::*>
      <li><xsl:value-of select="@nodeName" />
     </xsl:for-each>
    <ul>

    In C# you can do something similar, have a look at this topic.

  • rajeev 18 posts 38 karma points
    Feb 08, 2011 @ 08:42
    rajeev
    0

    i want to check the proopery set for the child pages/nodes in  a button event. That button is on parent page.  How can a macro do this for me?  Suppose this button is login button that checks the username/pwd  for its child pages. It redirect to then that child page whose username and password match with current login details.

     

     

     

     

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Feb 08, 2011 @ 09:29
    Sebastiaan Janssen
    0

    Right, that sounds overly complicated, but check the other topic that I linked to, it has the code to get the child pages. Using the childrenNodes variable you can do a for-loop. I am assuming you're somehow storing the username and password in the child document? You'd do a foreach where childNode.GetProperty("userName").Value == theUserName .. something like this.

    Personally, I'd recommend you create members and the members have a property on them that stores a nodeId. The nodeId is of the page that is "their" pages (the one you're redirecting to in your example). So when the member logs in, you redirect to that page that is in their member profile.

  • Stephen Maij 11 posts 36 karma points
    Feb 08, 2011 @ 09:30
    Stephen Maij
    1

    On the parent page:


    Node node = Node.GetCurrent();

    node.Children

Please Sign in or register to post replies

Write your reply to:

Draft