我有一个 KnockoutJS 视图模型,我将它作为 JSON 对象发布到 MVC 控制器,如下所示:
var dataObj = ko.toJSON(viewModel);
$.post(postURL, dataObj, callBackFunc);
模型本身有一个出生日期字段:
dataObj.DOB
但是,每当我的 MVC 控制器收到它时,DOB 字段总是#12:00:00 AM#
(VB.NET)
下面是我的控制器:
<HttpPost()> _
<AjaxOnly()> _
Public Function PersonalDetails(PersonalInfo As DetailsViewModel.PersonalDetails)
'clean the null values
Dim newValues As Dictionary(Of String, String) = _getPropertyDict(PersonalInfo)
Dim repo As New DetailsViewModelRepository()
For Each entry In newValues
repo.InsertUpdateField(PersonalInfo.MemberId, entry.Key, entry.Value)
Next
Return PartialView("~/Views/Home/Details/PersonalDetails.vbhtml", PersonalInfo)
End Function
如何让它正确接收日期?