There are different type of results that are available in ASP.net MVC. When create new controller, they will come with actions by default. The Empty controller includes an Index action with a return value of type ActionResult. ActionResul class is the base class for all action results.
There are different ActionResult types explained below.
ActionResult | Method | Description |
---|---|---|
ViewResult | View | Renders a view as a web page |
PartialViewResult | PartialView | Section of a view,that can be rendered inside another view |
RedirectResult | Redirect | Redirect to another action method |
RedirectToRouteResult | RedirectToRoute | Redirect to another action method |
ContentResult | Content | Returns a user-defined content type |
JsonResult | Json | Retuns a serialized JSON object |
JavaScriptResult | JavaScript | Returns a script that can be executed on the client |
FileResult | File | Returns a binary output to write to the response |
EmptyResult | — | returns a null result |