Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Razor: No overload for method 'Write' takes 0 arguments

Tags:

c#

razor

@{ 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!

like image 300
Ian Davis Avatar asked Dec 16 '10 23:12

Ian Davis


1 Answers

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++; } 
like image 64
Zote Avatar answered Sep 23 '22 16:09

Zote