Copied to clipboard

Flag this post as spam?

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


  • Lee 1123 posts 3059 karma points
    May 18, 2011 @ 11:20
    Lee
    0

    GetXmlNodeById With Razor?

    How would I go about using this with Razor?  I need to start from a specified node using Razor and then loop through the children of a specific doctype?

  • Alex 78 posts 136 karma points
    May 18, 2011 @ 11:28
    Alex
    1

    Model.NodeById(1234).Descendants("docTypeAlias")

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    May 18, 2011 @ 12:23
    Sebastiaan Janssen
    2

    And to loop through just the children (descendants go to deeper levels): 

    Model.NodeById(1234).Children.Where("NodeTypeAlias = \"docTypeAlias\"")

  • Alex 78 posts 136 karma points
    May 18, 2011 @ 18:16
    Alex
    0

    @Sebastiaan: Oops, good catch, I really should read the opening posts properly before replying!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies