HI guys i have a razor file Index.cshtml which needs to be converted to aspx...can any one help me how to declare the classes and model every thing in .cshtml to .aspx
Here is my Index.cshtml
code
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>
please can any one tell me how to write this code in aspx of MVC3
anil,
it bugged me that you found this so difficult to do that i had to come back and give you the base details on how to do it yourself (teach a man to fish etc.. :-)). anyway, from the top, do the NORMAL stuff that aspx pages have, in your case:
ok, now onto a sample block:
razor:
aspx:
as you can see, purely syntax changes required that should take no more than 5 mins really.
Good luck -let me know how it all pans out.