Copied to clipboard

Flag this post as spam?

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


  • Gordon Saxby 1465 posts 1887 karma points
    Oct 07, 2010 @ 15:11
    Gordon Saxby
    0

    Get details from a node from usercontrol

    I have a C# usercontrol and I want to search for a specific node (under the current one) by nodeName and retrieve a value from that node.

    I assume I need NodeFactory (?) but other than that ... I'm not sure! (Umbraco v4.5)

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Oct 07, 2010 @ 16:29
  • Ernst Utvik 123 posts 235 karma points
    Oct 08, 2010 @ 01:11
    Ernst Utvik
    0

    ..edit

     

  • Ernst Utvik 123 posts 235 karma points
    Oct 08, 2010 @ 01:12
    Ernst Utvik
    0

    Hendy's Umbraco helper class is also a great way to solve your problem. Download the dll, add it to your /bin folder and add a reference to it in VS.

    http://blog.hendyracher.co.uk/umbraco-helper-class/

    Then you can find your node and data with something like this:

    Node childnode = UmbracoHelper.GetChildNodeByName("nameOfNode");

    //Get document and retrieve data
    Document doc = new Document(childnode.Id);
    var docData = doc.getProperty("alias").Value.ToString();
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies