【发布时间】:2020-07-22 00:18:51
【问题描述】:
我必须从表中选择行,然后将其发送到 SQL SERVER 中的数据库以处理该数据。我认为我可以将这些选定的项目保存到 JSON 字符串中,然后存储过程可以接收该字符串。
我的 .cshtml 文件中有这个:
@model List<model.entity.Recibo>
@{
ViewBag.Title = "Recibos Pendientes";
}
<h2>RecibosPendientes</h2>
<div class="container-fluid">
<table class="table">
<tr class="btn-success">
<th></th>
<th>ID Recibo</th>
<th>Fecha</th>
<th>Concepto de Cobro</th>
<th>Seleccionar</th>
</tr>
@foreach (var objetoRecibo in Model)
{
<tr>
<td><a class="btn btn-info" href="~/Recibo/ReciboPendiente/@objetoRecibo.IdRecibo">Ver</a></td>
<td>@objetoRecibo.IdRecibo</td>
<td>@objetoRecibo.FechaEm</td>
<td>@objetoRecibo.NombreCC</td>
<td><input name="RecibosMarcados" type="checkbox" value="False" /> </td>
</tr>
}
</table>
<button type="button" class="fa-cc-visa" onclick="">Pagar</button>
</div>
当我按下 Pagar 按钮时,我不太确定如何保存选定的 ID 列并将其保存为 JSON 字符串。
【问题讨论】:
标签: c# asp.net sql-server asp.net-mvc