0
$http({
method: 'GET',

dataType: 'json',

url: 'Calendar/GetDate',

params: { calenderId: $scope.CalendarId, fyYear: new Date(viewValue).toUTCString() 

}
}).success(function (result) {

alert(result);

});

以下の値が返され、コントローラーメソッドが呼び出されない


[UMAuthorize]
public ActionResult GetDate(string calenderId, DateTime fyYear)
{
 ....... 
 .....
return Json(new { startDate }, JsonRequestBehavior.AllowGet);
}
4

2 に答える 2

0

I susupect the the url passed is wrong, use Url.Action() helper for generating correct url:

change:

url: 'Calendar/GetDate'

to:

url: '@Url.Action("GetDate","Calendar")'
于 2014-07-21T06:30:27.003 に答える