This works perfectly and will return all descendants of those nodetypes.
I'm now trying to recreate the same functionality inside a usercontrol but when I try I get the error: 'umbraco.NodeFactory.Node' does not contain a definition for 'Descendants'
Can I only use Descendants inside a macro? It always seems there are completely different ways of doing things in macros, usercontrols etc. Is there a standard namespace that works across all of these?
DynamicNode root = new DynamicNode(1053);
DynamicNodeList nodes = root.Descendants();
But I can't construct my Where clause as I have done for my razor macro in the first post. Is there a different technique within usercontrols? If you could point me in the direction of some docs that would be greatly appreciated as so far I can't find what I'm looking for.
Using Descendants() in a UserControl
Hi all,
In a macro script I can use something like:
This works perfectly and will return all descendants of those nodetypes.
I'm now trying to recreate the same functionality inside a usercontrol but when I try I get the error: 'umbraco.NodeFactory.Node' does not contain a definition for 'Descendants'
Can I only use Descendants inside a macro? It always seems there are completely different ways of doing things in macros, usercontrols etc. Is there a standard namespace that works across all of these?
Thanks, Ian.
Comment author was deleted
Yeah but that isn't part of the nodefactory look at using the dynamic objects instead
Thanks Tim.
I've gotten as far as:
But I can't construct my Where clause as I have done for my razor macro in the first post. Is there a different technique within usercontrols? If you could point me in the direction of some docs that would be greatly appreciated as so far I can't find what I'm looking for.
is working on a reply...