Bryant Farley
asked on
@Html.EditorFor displays mm/dd/yyyy rather than date
My model has a field, CloseDate, defined as datetime.
It's displayed on my Edit page as follows:
If I enter or select a date, and click Save, the value is saved to my database. However, when the record is again displayed in Edit, I see the same mm/dd/yyyy placeholder that I did when CloseDate was null; and if I click Save, my originally selected date is saved as null.
What can I do to get around this? Have I missed something basic?
[Display(Name = "Close date")]
[DataType(DataType.Date)]
public Nullable<System.DateTime> CloseDate { get; set; }
It's displayed on my Edit page as follows:
@Html.EditorFor(model => model.TargetedFundingCloseDate)
If I enter or select a date, and click Save, the value is saved to my database. However, when the record is again displayed in Edit, I see the same mm/dd/yyyy placeholder that I did when CloseDate was null; and if I click Save, my originally selected date is saved as null.
What can I do to get around this? Have I missed something basic?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER