Action Results in MVC

Different type of Action Results in MVC

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
  1. ViewResults                        View                         Render view as webpage to browser.
  2. PartialViewResults              PartialView              Render a section of view to another view.
  3. ContentResult                      Content                    Return user define Content data.
  4. JsonResult                           Json                          Return value in (name, value) pair.
  5. EmptyResult                       None                         No Return.
  6. FilePathResult                    File                            Return page through  file path                                                                                                        ex:- file("~/Content/style.css","text/css")
  7. HttpUnAuthorizedResult                                     Return an Http 403 status
  8. JavascriptResult                 Javascript                  Return the Script to execute.
  9. RedirectResult                   Redirect                     Redirect the client to new Url.
  10. RedirectToRouteResult     ( RedirectToAction/   Redirect to another Action                                                                              RedirectToRoute)
                                                       
      

Share this

Previous
Next Post »