what's wrong with that code ? I'm getting the error from this topic's title.
@{ var errors = ViewData.ModelState.Values.Where(x=>x.Errors.Count > 0).ToList();}
SOLVED, look @ the comments
Inside a using
statement or other code block, Razor expects code, not markup.
Therefore, you must put in code directly, not in @{ ... }
blocks.
The Razor parser interprets your code as @
(printing an empty expression), followed by a normal C# statement block ({ ... }
).
You only use @{ ... }
blocks to put code where Razor is expecting markup.
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