- MVC_Views.zip
- CodeProject_Article_MVC_Views
- Code
- MVC_Views
- Different_MVC_Views.docx
|
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MVC_ASPX.Models.Product>>" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>ProductView</title>
</head>
<body>
<h2>Products List - ASPX View</h2>
<p>
<%: Html.ActionLink("Create New", "Create") %>
</p>
<table>
<tr>
<th></th>
<th>
ProductID
</th>
<th>
ProductName
</th>
<th>
Quantity
</th>
<th>
Price
</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.ProductID %>
</td>
<td>
<%: item.ProductName %>
</td>
<td>
<%: item.Quantity %>
</td>
<td>
<%: String.Format("{0:F}", item.Price) %>
</td>
</tr>
<% } %>
</table>
</body>
</html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.