I am using an if else in Razor view to check for null value like this:
@foreach (var item in Model)
{
-
There are actually two other ways to display text from a code block in razor besides the suggested @(""), using a tag and it's shorthand @:
@{
@("--")
--
@:--
}
The code above will display -- three times.
- 热议问题