MVC内置了很多实用的ActionResult
Action Result
|
Helper Method
|
Description
|
ViewResult
|
View
|
Returns a view as a webpage
|
PartialViewResult
|
PartialView
|
Returns a partial view. A partial view has the same role as a user control. A partial view will be rendered within a main view
|
RedirectResult
|
Redirect
|
Redirects to another action method based on its URL
|
RedirectToRouteResult
|
RedirectToAction
RedirectToRoute
|
Redirects to another action method
|
ContentResult
|
Content
|
Returns a user defined content type
|
JsonResult
|
Json
|
Returns a serialized JSON object
|
JavaScriptResult
|
JavaScript
|
Returns a script that can be executed on the client
|
FileResult
|
File
|
Returns binary output to write to the response
|
FileStreamResult
|
File
|
Returns a file stream
|
FilePathResult
|
File
|
Returns a file path
|
FileContentResult
|
File
|
Returns the content of a file
|
EmptyResult
|
(None)
|
Used with void action methods which doesn’t return a value
|
HttpStatusCodeResult
|
|
Returns an HTTP Status code
|
HttpNotFoundResult
|
|
Returns HTTP Not Found
|
HttpUnauthorizedResult
|
|
Return HTTP Not Authorized
|