我有一些代码,例如:
<table class="invisibleforprint">
<thead>
<tr class="mainheader">
<th>@Html.ActionLink("Invoice Number", "Index", new { sortOrder= ViewBag.NumberSortParm })</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model) {
<tr>
<td class="invoiceActions">
<input type="button" class="btnresetinvoice button" value="Reset" data-invoiceid="@item.InvoiceId" />
</td>
</tr>
}</tbody>
</table>
哪个编译好。我去并在输入中添加了一个 if 语句:
<table class="invisibleforprint">
<thead>
<tr class="mainheader">
<th>@Html.ActionLink("Invoice Number", "Index", new { sortOrder= ViewBag.NumberSortParm })</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model) {
<tr>
<td class="invoiceActions">
<input type="button" class="btnresetinvoice button" value="Reset" data-invoiceid="@item.InvoiceId" @{ if(item.PMApproved != true) { @:disabled="disabled" } } />
</td>
</tr>
}</tbody>
</table>
它给出了错误'}预期'
说什么?我添加了等量的左括号。
有谁知道我做错了什么?