20

What are all the methods that return an ActionResult in ASP.NET MVC as of right now (ie. RedirectToAction, etc.)

I haven't found a good documentation resource that lists this kind of stuff.

KingNestor
  • 65,976
  • 51
  • 121
  • 152

2 Answers2

28

Found from here

System.Web.Mvc.ActionResult
    System.Web.Mvc.ContentResult
    System.Web.Mvc.EmptyResult
    System.Web.Mvc.FileResult
    System.Web.Mvc.HttpUnauthorizedResult
    System.Web.Mvc.JavaScriptResult
    System.Web.Mvc.JsonResult
    System.Web.Mvc.RedirectResult
    System.Web.Mvc.RedirectToRouteResult
    System.Web.Mvc.ViewResultBase

Methods on the controller object are here

There is:

Content
File
Javascript
Json
PartialView
Redirect
RedirectToAction
RedirectToRoute
View
Jake
  • 3,427
  • 2
  • 28
  • 23
4

From ActionResult types in MVC2:

  • ContentResult – Represents a text result.

  • EmptyResult – Represents no result.

  • FileContentResult – Represents a downloadable file (with the binary content).

  • FilePathResult – Represents a downloadable file (with a path).

  • FileStreamResult – Represents a downloadable file (with a file stream).

  • JavaScriptResult – Represents a JavaScript script.

  • JsonResult – Represents a JavaScript Object Notation result that can be used in an AJAX application.

  • PartialViewResult – Represents HTML and markup rendered by a partial view.

  • RedirectResult – Represents a redirection to a new URL.

  • RedirectToRouteResult – Represents a result that performs a redirection by using the specified route values dictionary.

  • ViewResult – Represents HTML and markup rendered by a view.

stuartd
  • 70,509
  • 14
  • 132
  • 163
Raj Kaimal
  • 8,304
  • 27
  • 18