我有在剃刀foreach循环形式的标签的问题,当渲染输出HTML是错误的,因为在第一次迭代的形式标记在这里消失是剃刀代码
@foreach (var item in Model)
{
<tr>
<td>@if (item.IsMandatory)
{
<span class="label label-important">Obligatorio</span>
}
else
{
<span class="label">Opcional</span>
} </td>
<td>@Html.DisplayFor(modelItem => item.DocumentName)</td>
<td>
</td>
<td>
<form>
form here!
</form>
</td>
</tr>
}
这里所呈现的HTML:
<table class="table table-striped">
<thead>
<tr>
<th>Requerido</th>
<th>Documento</th>
<th>Accion</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="label label-important">Obligatorio</span>
</td>
<td>Copia de cédula</td>
<td>
here form! <----------Problem Here
</td>
</tr>
<tr>
<td>
<span class="label label-important">Obligatorio</span>
</td>
<td>
Copia de otro documento de identidad (licencia, pasaporte, seguro)
</td>
<td>
<form novalidate="novalidate">
here form!
</form>
</td>
</tr>