@using MileageTraker.Web.Utility @model DateTime? @{ Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml"; var val = Model.HasValue ? Model.Value.ToShortDateString() : string.Empty; } @Html.TextBox("", (Model != DateTime.MinValue ? val : string.Empty ), Html.GetInputSizeClass())