blazor inclide code blocks glitching @{} errors then {} scope errors

137 views Asked by At

When I don't use @ and just use {}, the scope breaks.

not using '@{}'

When I use @{} for the inline code, the scope works, but it errors because of the @

using '@{}'

Any suggestions? Sure looks like a glitch to me. Go Blazor!

Here's a third screenshot where the brackets aren't breaking scope. enter image description here

2

There are 2 answers

0
sirbradwick On BEST ANSWER

it actually worked with no brackets. The brackets were messing with the scope, when I thought they were required for in line code.

no brackets for the win

1
Henk Holterman On

Nothing to do with Blazor.

The var ticket is scoped by the { } block. The if(ticket == null) part is outside that block.

If you had posted the code as text and not as pictures I would have fixed it here.