Action Result
General
- ActionResult is a result of action methods or return types of action methods.
- Action result is a parent class for many of the derived classes that have associated helpers.
- The IActionResult return type is appropriate when multiple ActionResult return types are possible in an action.
- Most of the time an IActionResult have a corresponding View.
Helpers
| ActionResult | Helper | Description |
| ContentResult | Content |
Takes a string and returns it with a text/plain content-type header by default. Overloads enable you to specify the content-type to return other formats such as text/html or application/json |
| FileContentResult | File | Return a file from a byte array, stream or virtual path. |
| NotFoundResult | NotFound | Returns an HTTP 404 (Not Found) status code indicating that the requested resource could not be found. |
| PageResult | Page | Will process and return the result of the current page. |
| PartialResult | Partial | Returns a Partial Page. |
| RedirectToPageResult |
RedirectToPage RedirectToPagePermanent RedirectToPagePreserveMethod RedirectToPagePreserveMethodPermanent |
Redirects the user to the specified page. |
| ViewComponentResult | Returns the result of executing a ViewComponent. |
