Razor:方法“Write"没有重载需要 0 个参数 [英] Razor: No overload for method 'Write' takes 0 arguments
本文介绍了Razor:方法“Write"没有重载需要 0 个参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
@{ int i = 4; }
@foreach (string s in "1,2,3".Split(',')) {
@:s is equal to @s
@{ i++; }
}
我在@{ i++; 上得到方法'Write'没有重载需要0个参数"代码行.有什么想法吗?谢谢!
I get "No overload for method 'Write' takes 0 arguments" on the @{ i++; } line of code. Any thoughts? Thanks!
推荐答案
试试这个:
@{ int i = 4; }
@foreach (string s in "1,2,3".Split(',')) {
@:s is equal to @s
i++
}
或
@{ int i = 4; }
@foreach (string s in "1,2,3".Split(',')) {
<text>is equal to @s</text>
i++;
}
这篇关于Razor:方法“Write"没有重载需要 0 个参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文