I need my program to do the following flow control, but the else does not detect it, it's as if it was not written.
Code:
<table class="table">
<thead>
<tr>
<th>Remitente</th>
<th>Asunto</th>
<th>Recibido</th>
</tr>
</thead>
<tbody>
@foreach (var correo in Model)
{
DateTime horaRecibida = @correo.recibido;
DateTime horaActual = DateTime.Now;
Double minutos = horaRecibida.Subtract(horaActual).TotalMinutes;
if (minutos > 3)
{
<tr style="background-color:red">
<td>@correo.remitente</td>
<td>@correo.asunto</td>
<td>@correo.recibido</td>
</tr>
}
else
{
<tr>
<td>@correo.remitente</td>
<td>@correo.asunto</td>
<td>@correo.recibido</td>
</tr>
}
}
</tbody>
</table>
Error:
Compiler error message: CS1513:} expected
This error jumps into a self-generated class, if I remove the flow control from my .cshtml class there is no problem.