【发布时间】:2012-07-13 07:23:23
【问题描述】:
大家好,我有一个剃须刀文件 Index.cshtml,需要转换为 aspx...谁能帮我如何声明类并将 .cshtml 中的所有内容建模为 .aspx
这是我的Index.cshtml 代码
Index.cshtml
@model IEnumerable<Gridview_BugTracker.Models.BugTracker_DataHelper>
@{
ViewBag.Title = "Projects";
}
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table>
<tr>
<th>
ProjectName
</th>
<th>
Description
</th>
<th>
Status
</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.projectName)
</td>
<td>
@Html.DisplayFor(modelItem => item.Description)
</td>
<td>
@Html.DisplayFor(modelItem => item.status)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.projectName }) |
@Html.ActionLink("Details", "Details", new { id = item.Description }) |
@Html.ActionLink("Delete", "Delete", new { id = item.status })
</td>
</tr>
}
</table>
谁能告诉我如何用MVC3的aspx编写这段代码
【问题讨论】:
-
@jimtollan 我做到了,我在 >" %> 说 foreach 表达式无效..
标签: asp.net-mvc-3 c#-4.0