How can I remove the default value that is added by default to the textboxes of non nullable properties when using the EditFor helper? I don't want that behavior
EDIT
Sorry I didn't give enough information.
For example if you use Html.EditorFor with a property that is DateTime it will set the textbox value to 1/1/0001 automatically. If you use "DateTime?"(nullable), it won't, it just leaves the textbox empty.
You can use UIHint to do it.
Create a file called ShortDate.cshtml in EditorTemplates
Decorate your property with the UIHintAttribute referencing our EditorTemplate. Consider my Order class.
When you use
it should avoid the default value of DateTime
caveat: I just did simple tests, so please take a deep look into it.
hope it helps you