I am working on an ASP.NET MVC application. My model has a DateTime field i.e.
[DisplayFormat(DataFormatString = "{0:h:mm tt}")] [DataType(DataType.DateTime)] public DateTime? CompletedDate { get; set; } I have to show this in a DateTime control on front end (cshtml). My code for this in cshtml is:
@Html.TextBoxFor(m => m.model.CompletedDate, new { type = "datetime-local" }) Value of model.CompletedDate is 2020-06-15 11:00:00.000 but i don't get this value binded with my control. I get this:
I have to use DateTime control and can not use simple textbox. Can anyone help me. I am stuck here and didn't find anything on the google yet.
