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
Hi,
I'm trying to filter nodes that have a property (researchFeatured) of datatype 'True/false' checked.
my razor looks like this:
DynamicNode featuredResearch = @Model.AncestorOrSelf().Descendants("ResearchProjectArea").Where("featuredResearch").First();
'(featuredResearch).GetChildrenAsList threw an exception of type System.NullReferenceException'
how can I solve this, all I want to do is get researchProject nodes that have their 'featuredResearch' property checked.
Thanks for your help,
Anthony
solved it:
DynamicNode featuredResearch = @Model.AncestorOrSelf().Descendants("ResearchProject").Where("researchFeatured").First();
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
problem with Razor Where clause
Hi,
I'm trying to filter nodes that have a property (researchFeatured) of datatype 'True/false' checked.
my razor looks like this:
DynamicNode featuredResearch = @Model.AncestorOrSelf().Descendants("ResearchProjectArea").Where("featuredResearch").First();
'(featuredResearch).GetChildrenAsList threw an exception of type System.NullReferenceException'
how can I solve this, all I want to do is get researchProject nodes that have their 'featuredResearch' property checked.
Thanks for your help,
Anthony
solved it:
DynamicNode featuredResearch = @Model.AncestorOrSelf().Descendants("ResearchProject").Where("researchFeatured").First();
is working on a reply...