Display data from a page directly onto it's grandparent, using Razor
Hi All,
In short, I want to display data from a page onto it's grandparent, using Razor.
In long, I have a section with three levels, the grandparent, parent and child node. On the child node I have several text string properties that I want to display on both of it's ancestors, but due to the site structure I need to be able to pull in the info directly onto the grandparent. The bottom level has it's own doctype which I'm sure will help things, and I'm fairly sure I can use DescendantOrSelf somehow, but I'm unsure of the correct method.
Display data from a page directly onto it's grandparent, using Razor
Hi All,
In short, I want to display data from a page onto it's grandparent, using Razor.
In long, I have a section with three levels, the grandparent, parent and child node. On the child node I have several text string properties that I want to display on both of it's ancestors, but due to the site structure I need to be able to pull in the info directly onto the grandparent. The bottom level has it's own doctype which I'm sure will help things, and I'm fairly sure I can use DescendantOrSelf somehow, but I'm unsure of the correct method.
Kind Regards
Hi. I think in Razor it can look like:
or:
depending on what syntax you prefer - strongly-typed or dynamic.
Ah, thank you! The second option worked perfectly for me!
is working on a reply...