Why is the second if statement incorrect? note that I attempted to make it a single line.
thanks
After Andrei Andrushkevich suggestion, red code. Tree and ul are red/squiggled. Plus the function param is red and all references in the blurred code is red.
The @:
sequence indicates that the entire line of content that follows should be treated as a content block.
So @if (condition) { @: Some content }
won't work because the last bracket is interpreted as content and another ending }
will be expected.
For single line conditions you can use the <text>
tag:
@if (condition) { <text>Some content</text> }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With