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

49 lines
1.1 KiB
Plaintext

@model IEnumerable<WebApplication1.Models.news>
@{
ViewBag.Title = @ViewBag.title;
}
<h2>@ViewBag.title</h2>
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.title)
</th>
<th>
@Html.DisplayNameFor(model => model.tag)
</th>
<th>
category
</th>
<th></th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.title)
</td>
<td>
@Html.DisplayFor(modelItem => item.tag)
</td>
<td>
@Html.DisplayFor(modelItem => item.cat)
</td>
<td>
@Html.ActionLink("Read", "../news/Details", new { id = item.ID })|
@if (ViewBag.role == 1 || ViewBag.uid == item.userID)
{
@Html.ActionLink("Edit", "../news/Edit", new { id = item.ID })
<span>|</span>
@Html.ActionLink("Delete", "../news/Delete", new { id = item.ID })
}
</td>
</tr>
}
</table>