ASP.NET MVC - Passing JSON DateTime to controller not mapping to controller parameters

前端 未结 4 1264
既然无缘
既然无缘 2021-02-07 02:02

I am using a jQuery calendar to display events, which is designed to pull data from the server. On innit the calendar fires off a AJAX request to get an array of events objects

4条回答
  •  南方客
    南方客 (楼主)
    2021-02-07 02:43

    You need to use return type as 1JsonResult1s instead of 1ActionResult1s

    your code goes somthing like this

    public JasonResult(DateTime start, DateTime end) {
        //some logic
        return Json(); // you can pass any values within Json() with new keyword
    }
    

提交回复
热议问题