Gajanan Chavhan

Gajanan Chavhan

  • 962
  • 818
  • 148.3k

Model is not binding

Apr 20 2018 2:09 AM
Model is not binding when submitting form using MVC post request. It gives an error for "DateTime" field as The value '20/04/2018' is not valid. I am using Datetime format as "dd/MM/yyyy". If I use "DateTime" format as "MM/dd/yyyy" it is working fine.
 
Below is my DateTime field code:
@Html.TextBoxFor(m => m.JoiningDate, "{0:dd-MM-yyyy}",
new {Name = Html.NameFor(m => m.JoiningDate))
 
JoiningDate: Is of DateTime.
 
Thanks 

Answers (1)