我在MVC视图中有一个这样的表:
@foreach (var item in Model.listContract)
{
<tr style="font-size:11px;">
<td><span> <div class="btn btn-crimson btn-inline-block" data-toggle="modal" data-target="@item.ID"><a href="#" class="btn-view-more">View more info</a></div> </span></td>
<td>@item.ID</td>
<td>@item.name</td>
<td>@item.Phone</td>
<td>@item.Passport</td>
<td>@item.CustomerID</td>
</tr>
}
如何将所有数据从<tr>
传递到模型中。像这样:
<div class="modal" id="@item.ID">
<!-- Modal body -->
<div class="modal-body">
@item.name - @item.Phone .....
</div>
</div>