Here's the problem:
a date formatted in Configuration.cs as this:
EventStartDateTime=DateTime.Parse("2/16/2008 12:15:12 PM")
then showing in the Db table as this:
2008-02-16 12:15:12.000
and when coming into the Index.cshtml here:
@Html.DisplayFor(modelItem => item.EventStartDateTime)
at the break, the hover over shows this:
item.EventStartDateTime.Date {2/16/2011 12:00:00 AM}
but the page crashes and gives this error message:
"
Exception Details: System.FormatException: Input string was not in a correct format.
"
????
what is going on here?
What I have tried:
i tried stringing it as:
@Html.DisplayFor(modelItem => item.EventStartDateTime.ToLongDateString())
but i get this error msg, which i do not understand at all.
"Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions."
also, when i tested the date string in the MS sample console project, it worked as expected, which left me totally confounded.
is the error in something Razor wants, or ???