Files
newswebappTest/Views/categories/Index.cshtml
lianpi3 07ffa3303d fix category,tag, news list
fix edit account details bug
2024-08-06 16:34:13 +03:30

46 lines
952 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 == 1)
{
@Html.ActionLink("Edit", "Edit", new { id = item.ID })
<span>|</span>
@Html.ActionLink("Delete", "Delete", new { id = item.ID })
}
</td>
</tr>
}
</table>