@model SportsStore.Domain.Entities.Product @{ ViewBag.Title = "Admin: Edit " + Model.Name; Layout = "~/Views/Shared/_AdminLayout.cshtml"; } @*

Edit @Model.Name

@using (Html.BeginForm()) { @Html.EditorForModel() @Html.ActionLink("Cancel and return to List", "Index") }*@

Edit @Model.Name

@using (Html.BeginForm("Edit", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" })) {
@Html.HiddenFor(m => m.ProductID) @foreach (var property in ViewData.ModelMetadata.Properties) { switch (property.PropertyName) { case "ProductID": case "ImageData": case "ImageMimeType": break; default: if (property.PropertyName != "ProeuctID") {
@if (property.PropertyName == "Description") { @Html.TextArea(property.PropertyName, null, new { @class = "form-control", rows = 5 }) } else { @Html.TextBox(property.PropertyName, null, new { @class = "form-control" }) } @Html.ValidationMessage(property.PropertyName)
} break; } }
Choose File...
@if (Model.ImageData == null) {
No Image
} else { }
}