Copied to clipboard

Flag this post as spam?

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


  • Lee 1130 posts 3088 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 5045 posts 15476 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!

Please Sign in or register to post replies

Write your reply to:

Draft