gpt4 book ai didi

asp.net-mvc-3 - 如果为空,则 webgrid 内的自定义消息

转载 作者:行者123 更新时间:2023-12-01 09:06:37 25 4
gpt4 key购买 nike

  @if (Model.ActivityCollection.Count > 0)
{
var grid = new WebGrid(source: Model.ActivityCollection, rowsPerPage: 12, canSort: false);
@grid.GetHtml(tableStyle: "webGrid",
headerStyle: "header",
alternatingRowStyle: "alt",
columns: grid.Columns(
grid.Column("EffectiveDate", "Effective Date", style: "date"),
grid.Column("PremiumPaymentAmount", "Premium Payment Amount", style: "amount"),
grid.Column("PaymentType", "Payment Type", style: "date")
));
}
else
{

}

我想在上述 else 语句的网络网格内显示一条消息“未找到付款信息”。有人可以帮我解决这个问题吗?

最佳答案

<div class="grid" style="margin-left:5px;" id="grid">          
@if (Model.ActivityCollection.Count > 0)
{
var grid = new WebGrid(source: Model.ActivityCollection, rowsPerPage: 12, canSort: false);
@grid.GetHtml(tableStyle: "webGrid",
headerStyle: "header",
alternatingRowStyle: "alt",
columns: grid.Columns(
grid.Column("EffectiveDate", "Effective Date", style: "date"),
grid.Column("PremiumPaymentAmount", "Premium Payment Amount", style: "amount"),
grid.Column("PaymentType", "Payment Type", style: "date")
));
}
else
{
<div class="grid">
<table cellspacing="0" width="80%">
<thead>
<tr>
<th>Effective Date</th>
<th>Premium Payment Amount</th>
<th>Payment Type</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="3" align="center" ><br />No payment information found<br /><br /> </td>
</tr>
</tbody>
</table>
<br/><br/><br/><br/>
</div>
}
</div>

关于asp.net-mvc-3 - 如果为空,则 webgrid 内的自定义消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6665617/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com