-1
嗨,我有一個剃鬚刀文件Index.cshtml需要轉換爲aspx ...任何人都可以幫助我如何聲明類和模型.cshtml中的每一件事.aspx將剃鬚刀轉換爲MVC3中的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
@jimtollan我這樣做了,我在<%@ Page Title =「」Language =「C#」中創建一個錯誤MasterPageFile =「〜/ Views/Shared/SiteMaster.Master」Inherits =「System.Web.Mvc。 ViewPage>「%>說無效expressionterm foreach .. –
SoftwareNerd
2012-07-13 08:02:23