I have a DateTime? StartDate { get; set; } in my asp.net mvc viewmodel, and I tried to do Html.EditorFor(x => x.StartDate) in my view. I got an error
The model item passed into the dictionary is null, but this dictionary requires a non-null model item of type ‘System.DateTime’.
Anything good way to get around this without creating a non-nullable surrogate property on my viewmodel?
This might be the answer to your issue:
Credit:
ASP.NET MVC 2 – Html.EditorFor a nullable type?