I’m storing tasks in a database. Each task can be solved or open, so I created a column isSolved containing true or false in the DB, depending on the status.
Now I would like to display a list of all tasks and set the background color of the row for solved tasks to green and for unsolved tasks to red. But how can I realize this inside of the .cshtml file?
You can use the
@()to do the conditional check inside a view.CSS