@model IEnumerable<Framely2011.Models.Frames>
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table>
<tr>
<th></th>
<th>
PictureID
</th>
<th>
UserID
</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
@Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
@Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
</td>
<td>
@item.PictureID
</td>
<td>
@item.UserID
</td>
<td>
Meta 1: @item.MetaTagsObj.Meta1 Meta 2: @item.MetaTagsObj.Meta2 Meta 3: @item.MetaTagsObj.Meta3
</td>
</tr>
}
</table>
Если модель выйдет пустой, как я могу просто заставить ее напечатать «Нет фреймов», так что ни одна из таблиц html не будет напечатана вообще, я думаю, что простого оператора if
будет достаточно, но я новичок в бритве, и я не был уверен, как мне поступить так.