I try to check boolean and then show an integer:
@( ViewBag.HaveBeenHere ? submission.DurationInMonths )
I get an error message:
CS1003: Syntax error, ':' expected
I know that: for another, but in this case I have no other.
When I add it like this:
@( ViewBag.HaveBeenHere ? submission.DurationInMonths : "" )
I get this error:
CS0173: The conditional expression type cannot be determined because there is no implicit conversion between 'int' and 'string'
How to make a reduction operator to check a boolean and display an integer in a view?
source
share