I have 2 questions:
See Question&Answers more detail:os
What is the difference between JSONResult and ActionResult?
When to use JSONResult in MVC?
I have 2 questions:
See Question&Answers more detail:os
What is the difference between JSONResult and ActionResult?
When to use JSONResult in MVC?
ActionResult
is an abstract class that an action can return.
The helper methods in Controller
(eg, Json()
, Content()
, View()
, ...) return different concrete classes that inherit ActionResult
, including JsonResult
.
You should declare your action methods as returning ActionResult
, so that they have the freedom to return any concrete result class.