I am very new to C# and ASP.NET MVC Razor. I want to show a field in my view if the field is not blank.
Code
-
2021-02-05 17:33
I would calculate the class name in a code block and output that. Something along the lines of:
@{
var phone2ClassName = string.IsNullOrWhiteSpace(Model.phone2) ? "hide" : string.Empty;
}
...