Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nigel Wilson 945 posts 2077 karma points
    Oct 18, 2009 @ 19:07
    Nigel Wilson
    0

    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

  • Nigel Wilson 945 posts 2077 karma points
    Oct 18, 2009 @ 21:04
    Nigel Wilson
    0

    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

  • Jannik Nilsson 38 posts 81 karma points
    Oct 19, 2009 @ 10:39
    Jannik Nilsson
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft