62,046
社区成员
发帖
与我相关
我的任务
分享
public ActionResult NewsList()
{
return View(list);
}
<table>
<tr>
<th>
编号
</th>
<th>
<%= Html.ActionLink("标题", "SortNews", new { desc = Convert.ToBoolean(ViewData["desc"]), sortName = "Title", page = currentPage })%>
</th>
<th>
内容
</th>
<th>
作者
</th>
<th>
创建时间
</th>
<th>
编辑
</th>
</tr>
<% foreach (var item in Model)
{ %>
<tr>
<td>
<%: item.Id %>
</td>
<td>
<%: item.Title %>
</td>
<td>
<%: item.Content %>
</td>
<td>
<%: item.Author %>
</td>
<td>
<%: String.Format("{0:g}", item.CreateTime) %>
</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>
<% } %>