I am using an if else in Razor view to check for null value like this:
@foreach (var item in Model)
{
-
That's because you are using the Display()
method incorrectly. The overload you are using is Display(HtmlHelper, String). If you are looking for "--" to be the text, you should use something like:
@Html.Label("--");
- 热议问题