add categories(add, list, list news)

minor form changes
add news controller and views
This commit is contained in:
2024-07-28 18:35:11 +03:30
parent 30ac6724ca
commit a74072b491
22 changed files with 1092 additions and 148 deletions

View File

@ -0,0 +1,49 @@
@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.link)
</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.link)
</td>
<td>
@Html.DisplayFor(modelItem => item.tag)
</td>
<td>
@Html.DisplayFor(modelItem => item.cat)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
@Html.ActionLink("Details", "Details", new { id = item.ID }) |
@Html.ActionLink("Delete", "Delete", new { id = item.ID })
</td>
</tr>
}
</table>