@model Vidly.ViewModels.CustomerFormViewModel @{ /**/ ViewBag.Title = "New"; Layout = "~/Views/Shared/_Layout.cshtml"; } @if (Model.Customer.Id==null|| Model.Customer.Id == 0) {

New Customer

} else {

Edit Customer

} @using (@Html.BeginForm("Save", "Customers")) {
@Html.LabelFor(m => m.Customer.Name) @Html.TextBoxFor(m => m.Customer.Name, new { @class = "form-control" })
@Html.LabelFor(m => m.Customer.BirthDate) @Html.TextBoxFor(m => m.Customer.BirthDate, "{0:d MMM yyyy}", new { @class = "form-control" })
@Html.LabelFor(m => m.Customer.MembershipTypeId) @Html.DropDownListFor(m => m.Customer.MembershipTypeId, new SelectList(Model.MembershipTypes, "Id", "Name"), "Select membership Type", new { @class = "form-control" })
@Html.HiddenFor(m => m.Customer.Id) }