@{ int i = 4; } @foreach (string s in "1,2,3".Split(',')) { @:s is equal to @s @{ i++; } }
I get "No overload for method 'Write' takes 0 arguments" on the @{ i++; } line of code. Any thoughts? Thanks!
Try this:
@{ int i = 4; } @foreach (string s in "1,2,3".Split(',')) { @:s is equal to @s i++ }
or
@{ int i = 4; } @foreach (string s in "1,2,3".Split(',')) { <text>is equal to @s</text> i++; }
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