<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        <%= Html.Encode(ViewData["Message"]) %></h2>
    <p>
        To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">
            http://asp.net/mvc</a>.<a href="http://www.51aspx.com/CV/MvcExamples" title="下载">Download</a>.
    </p>
    <div>
        <%=Html.ActionLink("新建", "Edit")%>
    </div>
    <table width="100%">
        <tr>
            <th>
                商品名称
            </th>
            <th>
                编辑
            </th>
        </tr>
        <%foreach (var item in ViewData["Product"] as PagedList<Product>)
          { %>
        <tr>
            <td>
                <%=item.ProductName %>
            </td>
            <td align="center">
                <%=Html.ActionLink("编辑", "Edit", new {id=item.PID })%>
                <%=Html.ActionLink("删除", "Delete", new {id=item.PID })%>
            </td>
        </tr>
        <%} %>
    </table>
    <%=Html.MikePager(ViewData["Product"] as PagedList<Product>)%>
</asp:Content>
