【发布时间】:2022-01-01 16:34:09
【问题描述】:
在我的应用程序中有一个表格显示我从控制器传递的数据。
在最后一列中,我想通过将数量和单位金额数据相乘来显示总金额。
我可以得到帮助来执行此方法吗?提前致谢。
这里是代码
<div class="row">
<div class="col-12 table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>Requesting Item</th>
<th>Required Qty</th>
<th>Unit Amount</th>
<th>Total Amount</th>
</tr>
</thead>
<tbody>
@{int RowNo = 0;}
@for (int i = 0; i < Model.First().PurchaseOrderItems.Count; i++)
{
<tr>
<td>@{RowNo++;} @RowNo</td>
<td>@Html.DisplayFor(Model => Model.First().PurchaseOrderItems[i].Item_Description)</td>
<td>@Html.DisplayFor(Model => Model.First().PurchaseOrderItems[i].Qty)</td>
<td>Rs.@Html.DisplayFor(Model => Model.First().PurchaseOrderItems[i].UnitAmount)</td>
<td></td>
</tr>
}
</tbody>
</table>
</div>
</div>
【问题讨论】:
标签: javascript html asp.net-mvc asp.net-mvc-4