Files
newswebappTest/Views/categories/Index.cshtml
2024-08-10 17:10:45 +03:30

46 lines
951 B
Plaintext

@model IEnumerable<WebApplication1.Models.category>
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.link)
</th>
<th>
@Html.DisplayNameFor(model => model.title)
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.link)
</td>
<td>
@Html.DisplayFor(modelItem => item.title)
</td>
<td>
@Html.ActionLink("Details", "Details", new { id = item.ID }) |
@if (ViewBag.role > 0)
{
@Html.ActionLink("Edit", "Edit", new { id = item.ID })
<span>|</span>
@Html.ActionLink("Delete", "Delete", new { id = item.ID })
}
</td>
</tr>
}
</table>