Custom MVC WebGrid Demo 1 · Server Code


@model MyMvc4App.Models.Product

@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Layout_WebGridDemo1.cshtml";
}

<h2>Product Details</h2>

<table style="margin-left:41px">
    <tr>
        <td class="right-align">Product Number</td>
        <td>@Html.DisplayFor(model => model.ProductNumber)</td>
    </tr>
    <tr>
        <td class="right-align">Name</td>
        <td>@Html.DisplayFor(model => model.Name)</td>
    </tr>
    <tr>
        <td class="right-align">Color</td>
        <td>@Html.DisplayFor(model => model.Color)</td>
    </tr>
    <tr>
        <td class="right-align">Standard Cost</td>
        <td>@Html.DisplayFor(model => model.StandardCost)</td>
    </tr>
    <tr>
        <td class="right-align">List Price</td>
        <td>@Html.DisplayFor(model => model.ListPrice)</td>
    </tr>
    <tr>
        <td class="right-align">Size</td>
        <td>@Html.DisplayFor(model => model.Size)</td>
    </tr>
    <tr>
        <td class="right-align">Weight</td>
        <td>@Html.DisplayFor(model => model.Weight)</td>
    </tr>
    <tr>
        <td class="right-align">Product Category</td>
        <td>@Html.DisplayFor(model => model.ProductCategory.Name)</td>
    </tr>
    <tr>
        <td class="right-align">Product Model</td>
        <td>@Html.DisplayFor(model => model.ProductModel.Name)</td>
    </tr>
    <tr>
        <td class="right-align">Sell Start Date</td>
        <td>@Html.DisplayFor(model => model.SellStartDate)</td>
    </tr>
    <tr>
        <td class="right-align">Sell End Date</td>
        <td>@Html.DisplayFor(model => model.SellEndDate)</td>
    </tr>
    <tr>
        <td class="right-align">Discontinued Date</td>
        <td>@Html.DisplayFor(model => model.DiscontinuedDate)</td>
    </tr>
</table>

<p>
    @*@Html.ActionLink("Edit", "Edit", new { id=Model.ProductID }) |*@
    @*@Html.ActionLink("Back to List", "Index")*@
    <a href="javascript:history.back();">Back to List</a>
</p>