On my MVC3 razor page I have a date field
@Html.EditorFor(model => model.Member.Dob)
Given below is the code I am trying to get a datepi
You'll need to create an EditorTemplate in your Views\Shared\EditorTemplate folder. Name it DateTime.cshtml. Should look something like the following:
@model System.DateTime?
@Html.Label("")
@Html.TextBox("", String.Format("{0:MM/dd/yyyy}",(Model == DateTime.MinValue)? null : Model), new { @class="text"})
Use it as follows:
@Html.EditorFor(model => model.Member.Dob)