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 1461 posts 1883 karma points
    Aug 22, 2011 @ 18:36
    Gordon Saxby
    0

    Get Node by Property value

    I need to update a property (called Available) on a collection of nodes (1+) from False to True. I am doing this in C# but this is not a User Control - it is the callback from PayPal. So, there is no "Current" page.

    How do I load each node into a "Document"? Once I've got it I know how to update it :-)

    I thought I could use Node.GetNodeByXpath() but I'm not sure what the path should be!

  • Gordon Saxby 1461 posts 1883 karma points
    Aug 22, 2011 @ 19:02
    Gordon Saxby
    1

    Ah, OK, I've done it! Here's the code in case it helps anyone else ... or, of course, in case anyone sees a problem with it ;-)

     

    soldProduct = new Document(Node.GetNodeByXpath(@"//*[string(productStockCode) = '" + this.ItemNumber[i] + "']").Id);

    "this.ItemNumber" is the product stock code I passed to PayPal and got passed back.

     

  • Eric Herlitz 97 posts 129 karma points
    May 03, 2013 @ 21:22
    Eric Herlitz
    0

    Thanks for telling, I was having issues in filtering out all nodes having a certain checked property

    This is my result

    var = uQuery.GetNodesByXPath("//*[string(showInMainMenu) = '1']");
  • Charles Afford 1163 posts 1709 karma points
    May 06, 2013 @ 17:51
    Charles Afford
    0

    Hi,  I am assumeing that you have some client and server side code.  So you could set a property of nodeId on your model.  Pre post set this property to the context node.  Then when a post is done pass the node id as a hidden field.  You should then have the nodeid as a property you can use server side?

Please Sign in or register to post replies

Write your reply to:

Draft