Return JsonResult using an ActionFilter on an ActionResult in a controller

前端 未结 3 1016
谎友^
谎友^ 2021-01-18 00:39

I want to return the Model (data) of a controller in different formats (JavaScript/XML/JSON/HTML) using ActionFilter\'s. Here\'s where I\'m at so far:

The ActionFilt

3条回答
  •  长发绾君心
    2021-01-18 01:38

    Have you tried:

    return Json(entries);
    

    with a return type of JsonResult on the controller action?

提交回复
热议问题