Files
newswebappTest/Views/news/Index.cshtml

64 lines
1.3 KiB
Plaintext

@using WebApplication1.Models
@model List<newsModel>
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table class="table">
<tr>
<th>
Title
</th>
<th>
Category
</th>
<th>
Tag
</th>
<th>
Publisher
</th>
<th>
Published On
</th>
<th>
views
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Title)
</td>
<td>
@Html.DisplayFor(modelItem => item.category)
</td>
<td>
@Html.DisplayFor(modelItem => item.tag)
</td>
<td>
@Html.DisplayFor(modelItem => item.DisplayName)
</td>
<td>
@Html.DisplayFor(modelItem => item.date)
</td>
<td>
@Html.DisplayFor(modelItem => item.views)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.NewsID }) |
@Html.ActionLink("Details", "Details", new { id = item.NewsID }) |
@Html.ActionLink("Delete", "Delete", new { id = item.NewsID })
</td>
</tr>
}
</table>