Razor: No overload for method 'Write' takes 0 arguments
@{ int i = 4; }
@foreach (string s in "1,2,3".Split(',')) {
@:s is equal to @s
@{ i++; 开发者_StackOverflow}
}
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++;
}
精彩评论