How to set html attributes using when Razor?
In the below code, I'd like to set the class attribute of element if "Succeeded" property of the current model is true.
<tbody>
@foreach (CharlieTestRunViewModel charlieTestRunViewModel in Model)
{
<tr class="@if([email protected]){'trFailedTestRun'}">
<td>
@charlieTestRunViewModel.Succeeded
</td>
</tr>
}
</tbody>
But it doesn't work.
How to achieve this?
Thanks