Hi say I have a view containing:
<table>
<tr>
<th>
Invoice Number
</th>
<th>
Invoice Date
</th>
<th>
Organisation
</th>
<th>
Region
</th>
<th>
Total Excluding GST
</th>
<th>
Total Including GST
</th>
<th>
</th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.InvoiceNumber)
</td>
<td>
@Html.DisplayFor(modelItem => item.InvoiceDate, "{0:D}")
</td>
<td>
@Html.DisplayFor(modelItem => item.Organisation.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Area.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.TotalExcludingGst)
</td>
<td>
@Html.DisplayFor(modelItem => item.TotalIncludingGst)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.Id })
</td>
</tr>
}
</table>
and each item has a boolean property Editable. Is there a way to make the Edit link visible/invisible based on the value of this property?
You can use an
if: