Have only recently discovered Umbraco and am loving it.
I am creating a user control for an enquiry form whereby all products will be listed under their respective categories.
The following code outputs the categories OK, but I then want to look for all the products under each category and bind them using a nested repeater. This bit I haven't been able to figure out !
Further to the above I had a thought whilst biking to work . . .
Would it be more practical to iterate through the XML "site tree" - maybe using nested for each loops, (or similar ?) to build the category and product lists.
There are about 6 categories and currently 20 products so not massive processing.
User Control and nested asp:repeaters
Hi there
Have only recently discovered Umbraco and am loving it.
I am creating a user control for an enquiry form whereby all products will be listed under their respective categories.
The following code outputs the categories OK, but I then want to look for all the products under each category and bind them using a nested repeater. This bit I haven't been able to figure out !
umbraco.presentation.nodeFactory.Node node = new umbraco.presentation.nodeFactory.Node(1072);
umbraco.presentation.nodeFactory.Nodes childrenNodes = node.Children;
categories.DataSource = childrenNodes;
categories.DataBind();
I am open to other suggestions - this was just an initial idea so if their is a better way then I'd love to hear it.
Thanks
Nigel
Further to the above I had a thought whilst biking to work . . .
Would it be more practical to iterate through the XML "site tree" - maybe using nested for each loops, (or similar ?) to build the category and product lists.
There are about 6 categories and currently 20 products so not massive processing.
Thanks
Nigel
Take a look at this link: http://support.microsoft.com/kb/306154
Replace all the sql calls with the Umbraco code to get your items
is working on a reply...