Compiler Error Message: CS1061: 'bool' does not contain a definition
for 'ToArray' and no accessible extension method 'ToArray' accepting a
first argument of type 'bool' could be found (are you missing a using
directive or an assembly reference?)
line 27
var haschildren = item.Children.Any(x => x.IsVisible()).ToArray();
if statement adding a &&
Hi,
I've got the following loop which works fine;
What I'm looking at changing the line;
To have something like
Basically I want to write it if has no or disableDropdown is ticked.
Thanks
Matt
Hi Matt,
That looks like it should be okay, what problem are you having?
Nik
Hi Nik,
Hope your well.
So even if I toggle the dropdown, the drop down doesn't disappear on the front end.
I'm not getting no errors so its hard to try and pin point the error.
Thanks
Matt
Try this:
Hi Nik,
No joy, although I'm now getting an error;
line 27
Ahh, sorry Matt, remove the
.ToArray()
bit from that line, I forgot when I was copying it from your initial post.Thanks
Nik
Sorry Nik I thought it was simple thing to do :(
Hi Matt,
Sorry my fault for rushing again, try this (yes the ToArray() has been left there on purpose this time).
You also might want to change the name of
haschildren
tochildren
so it better represents what is being stored in it.THanks
Nik
Hi Nik,
Hope you had a good weekend.
I tried the above but now getting the error;
CS0019: Operator '&&' cannot be applied to operands of type 'IPublishedContent[]' and 'bool'
Sorry noob coder here :)
Matt
is working on a reply...