Creating a list of parents and their children using @helper traverse
I am new to razor and am trying to create a navigational list consisting of parent nodes and their children, but I am having no luck getting it to work with nested foreach loops, so I am trying to use @helper traverse(dynamic node).
Creating a list of parents and their children using @helper traverse
I am new to razor and am trying to create a navigational list consisting of parent nodes and their children, but I am having no luck getting it to work with nested foreach loops, so I am trying to use @helper traverse(dynamic node).
Here is what I have, but it doesn't work:
Hi Steve
This should work if you have 2 levels.
Cheers Ali
I think you have problem in that page is a collection not a single node. Maybe try the below and then Ali's suggestion
Thanks Ali! I wish I understood how to do it with a (@helper) as well.
Hi Steve,
You can do it with a traverse helper, it's a bit more complicated and written for Mvc but take a look at this
Jeavon
Thanks, you are right. A little too much for me. Thanks anyway.
is working on a reply...