我正在使用一些日期参数对 Iframe url 进行编码:
var object = {
profileID: self.profileID(),
organisationID: self.organisationID(),
startDate: self.startDate(), // 09/04/2013
endDate: self.endDate() // 17/04/2013
};
iFrame.src = "ExportReportAllMediaDetailsCsv/?" + $.param(object);
编码的网址:
http://dev.neptune.local/Report/ExportReportAllMediaDetailsCsv/?profileID=41&organisationID=2252&startDate=09%2F04%2F2013&endDate=17%2F04%2F2013
但是,有时调用的方法无法识别传入的日期时间:
The parameters dictionary contains a null entry for parameter 'endDate' of non-nullable type 'System.DateTime'
这是方法签名:
[CustomAuthorize(Definitions.RoleAnalystManager, Definitions.RoleProjectManager)]
public ActionResult ExportReportAllMediaDetailsCsv(int profileID, int organisationID, DateTime startDate, DateTime endDate)