I am passing a model to a view partial containing a form that is being loaded asynchronously. Everything seems to be coming across as expected EXCEPT for a DateTime proprty, what would cause this to happen?
Javascript function
function loadUpdateEventForm(eventID) {
getEventDetails(eventID, function(dnnEvent) {
if(dnnEvent != null) {
$("#updateEventForm").load(urlEditEventForm, dnnEvent, function () {
$("form#updateEventForm").submit(function (event) { submitNewEvent(event); });
});
dialog = $("#updateEventForm").dialog({ modal: true, width: '80%', position: { my: 'top', at: 'top+150' } });
console.log(dnnEvent);
return;
}
});
}
Output from console.log(dnnEvent)
Object {EventID: 2524, EventName: "sample", EventDescription: "sample", EventTimeBegin: "/Date(1418709600000)/", UserID: 1}
C# Action method serving partial view
public ActionResult _EditForm(DNNEventUpdateModel dnnEvent)
{
return View(dnnEvent);
}
DNNEventUpdateModel
public class DNNEventUpdateModel
{
[Required]
public int EventID { get; set; }
[Required]
public string EventName { get; set; }
[Required]
[DataType(DataType.MultilineText)]
public string EventDescription { get; set; }
[Required]
public DateTime EventTimeBegin { get; set; }
public int UserID { get; set; }
public string EventTimeBeginForDisplay
{
get
{
return this.EventTimeBegin.ToShortDateString();
}
set
{
this.EventTimeBegin = Convert.ToDateTime(value);
}
}
}
Update
Just realized I forgot to post how this is coming across in the controller. Here is what I mean about the date: