Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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: 1084Product 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?
Nobody has any insight into why this might not work? The odd thing is that the values match...
Really could use help with this. Umbraco Razor drives me nuts sometimes...
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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?
Nobody has any insight into why this might not work? The odd thing is that the values match...
Really could use help with this. Umbraco Razor drives me nuts sometimes...
is working on a reply...