Basically, my datepicker uses UK format of dd/mm/yyyy
. But when I submit the form, ASP.net is clearly using US format.
(will only accept days if less than 12, i.e. thinks it is the month.)
public ActionResult TimeTable(DateTime ViewDate)
Is there a way to force it to recognise a certain way?
Strangely though, other methods of insert seem to recognise the correct format.
"The parameters dictionary contains a null entry for parameter ViewDate
of non-nullable type System.DateTime
for method System.Web.Mvc.ActionResult Index(System.DateTime)
in Mysite.Controllers.RoomBookingsController
. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter."