Different type of Action Results in MVC
Action Result are return type are set up by default inside the controller of the action method.
Action Result are return type are set up by default inside the controller of the action method.
- we can use different type of action result in action method to render output in browser.
- Action results will decide which type of format will return to view.
- ActionResult support all return type.
- Generally ActionResult is an Abstract class and there are many different derived ActionResults in MVC.
Action Results Helper Method Description
- ViewResults View Render view as webpage to browser.
- PartialViewResults PartialView Render a section of view to another view.
- ContentResult Content Return user define Content data.
- JsonResult Json Return value in (name, value) pair.
- EmptyResult None No Return.
- FilePathResult File Return page through file path ex:- file("~/Content/style.css","text/css")
- HttpUnAuthorizedResult Return an Http 403 status
- JavascriptResult Javascript Return the Script to execute.
- RedirectResult Redirect Redirect the client to new Url.
- RedirectToRouteResult ( RedirectToAction/ Redirect to another Action RedirectToRoute)