Currently I have an error adding some values of a foreach, the view is of extension .cshtml razor in C #, the code is as follows:
<div class="panel panel-primary">
<!-- Default panel contents -->
<div class="panel-heading">CC</div>
<div class="panel-body">
<table class="table" style="width:100%">
<thead style="background-color:#d6e7ee">
<tr>
<th>cc</th>
<th>Moneda</th>
<th>Porcentaje</th>
<th>Costo</th>
</tr>
</thead>
<tbody style="background-color:#f1f8f8" >
@{
Double TotalPorcentaje=0;
Double TotalCosto=0;
foreach (var item in Model.ListarCostos)
{
<text>
<tr>
<td>@item.strNombreCentrocosto</td>
<td>@item.strSimboloMoneda</td>
<td>@item.nPercentageCentroCosto %</td>
<td>@item.nCosto</td>
</tr>
[email protected];
[email protected];
</text>
}
}
@{
<text>
<tr>
<td colspan="2"><strong>TOTAL:</strong></td>
<td><strong>TotalPorcentaje</strong></td>
<td><strong>TotalCosto</strong></td>
</tr>
</text>
}
</tbody>
</table>
</div>
</div>
Can someone give me some references of the correct syntax, thank you very much.