[英]jQuery kendo data grid datetime binding error for asp.net mvc back end
我为我的 asp.net mvc 项目实现了 jQuery 剑道数据网格。 一切正常,但在更新行时我没有得到正确的日期时间属性值,即使它们被正确读取。 这是我前端的代码片段:
schema: {
model: {
id: "TruckMonthId",
fields: {
TruckMonthId: { editable: false, nullable: true },
NumberOfVehicles: { editable: false },
BillStartDate: { editable: false, type: "Date" },
BillEndDate: { editable: false, type: "Date" },
}
}
},
{ field: "BillStartDate", title: "Bill Start Date", template: '#= kendo.toString(ConvertToDate(BillStartDate), "MM/dd/yyyy" ) #', width: 100 },
但是在我的 controller 中,我的所有值都完美无缺,但是对于日期时间属性,我在调用 TryUpdateModel 方法后得到“{1/1/0001 12:00:00 AM}”。 后端代码片段如下:
public JsonResult UpdateBillStatus(FormCollection form)
{
BillStatusModel item = new BillStatusModel();
TryUpdateModel(item, form); // here all properties of item are okay expcept datetime
}
我错过了什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.