I am trying to test a property within a docType for a simple "true/fase" using @foreach (var item in alumniCategory.Where("notInclude != true").Take(6) ){, but it always returns as if the box is checked. What am I doing wrong.
I've tried Where("!notInclude"), Where("notInclude == false"), Where("notInclude != 0). But if I use Where("notInclude") it displays all the items with the notInclude box checked. Strange.
If I print the value of notInclude in the loop, it displays everything as having True except for items that I've selected the checkbox and on those I see "True True". Does that point to anything I should look at?
Sorry, this doesn't work Jeavon. I ended up using the code below. It's confusing because it is true without checking the box "notInclue" and false if the property box is checked.
@foreach(var item in alumniCategory.HasValue("notInclude").Take(6)){
item.Where()
I am trying to test a property within a docType for a simple "true/fase" using @foreach (var item in alumniCategory.Where("notInclude != true").Take(6) ){, but it always returns as if the box is checked. What am I doing wrong.
Hi Steve,
How about this?
I've tried Where("!notInclude"), Where("notInclude == false"), Where("notInclude != 0). But if I use Where("notInclude") it displays all the items with the notInclude box checked. Strange.
If I print the value of notInclude in the loop, it displays everything as having True except for items that I've selected the checkbox and on those I see "True True". Does that point to anything I should look at?
Does anyone see why my code would be forcing a boolen "True" even when the property is set for "False"?
Try this:
Sorry, this doesn't work Jeavon. I ended up using the code below. It's confusing because it is true without checking the box "notInclue" and false if the property box is checked.
Hi Steve,
That really doesn't make any sense. You are saying a check box that isn't being checked is returning true?
Perhaps you could try this snippet to see if it reveals anything, I would be interested to see the result?
Jeavon
Jeavon,
It outputs the node name, nothing for the middle "@node.notInclude" and "umbraco.MacroEngines.DynamicNull"
is working on a reply...