Copied to clipboard

Flag this post as spam?

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


  • Robert J. Bullock 386 posts 404 karma points
    Aug 01, 2012 @ 17:54
    Robert J. Bullock
    0

    Trying to find a node based on content picker value... What is wrong with this code?!

    This works:

    var divisionPage Model.AncestorOrSelf(1).DivisionPages.First();
    <h2>@divisionPage.Title</h2>
    <p>Parent ID@Model.Parent.Id</p>
    <p>Product Folder@divisionPage.ProductFolder</p>

    Everything "matches up" as expected... i.e.:

    Parent ID: 1084
    Product Folder: 1084

    But if I try to filter to JUST include the DivisionPages that have their ProductFolder (content picker) value set to the parent ID of the current page, this does not work:

    dynamic divisionPage Model.AncestorOrSelf(1).DivisionPages.Where("productFolder==@0",Model.Parent.Id).First();

    No divisionPage is returned. What's up with that?

  • Robert J. Bullock 386 posts 404 karma points
    Aug 01, 2012 @ 21:22
    Robert J. Bullock
    0

    Nobody has any insight into why this might not work? The odd thing is that the values match...

  • Robert J. Bullock 386 posts 404 karma points
    Aug 02, 2012 @ 15:55
    Robert J. Bullock
    0

    Really could use help with this. Umbraco Razor drives me nuts sometimes...

  • 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