2012-06-18 11 views

cevap

13

:

@{ 
    // Get root node: 
    var root = Model.AncestorOrSelf(); 

    // Get all descendants, filter by type: 
    var nodes = root.Descendants("info"); 

    // Loop through the filtered nodes, displaying the properties: 
    <ul> 
    @foreach (var node in nodes) 
    { 
     <li> 
      <h2>@node.infoTitle</h2> 
      <div>@node.infoSummary</div> 
      <div>@node.infoBody</div> 
     </li> 
    } 
    </ul> 
}