开发者

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++;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜