Understanding Action Results
A controller action returns something called an action result. An action result is what a controller action returns in response to a browser request.
The ASP.NET MVC framework supports several types of action results including:
- ViewResult – Represents HTML and markup.
- EmptyResult – Represents no result.
- RedirectResult – Represents a redirection to a new URL.
- JsonResult – Represents a JavaScript Object Notation result that can be used in an AJAX application.
- JavaScriptResult – Represents a JavaScript script.
- ContentResult – Represents a text 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).
All of these action results inherit from the base ActionResult class.
…you call one of the following methods of the Controller base class:
- View – Returns a ViewResult action result.
- Redirect – Returns a RedirectResult action result.
- RedirectToAction – Returns a RedirectToRouteResult action result.
- RedirectToRoute – Returns a RedirectToRouteResult action result.
- Json – Returns a JsonResult action result.
- JavaScriptResult – Returns a JavaScriptResult.
- Content – Returns a ContentResult action result.
- File – Returns a FileContentResult, FilePathResult, or FileStreamResult depending on the parameters passed to the method.
So, if you want to return a View to the browser, you call the View() method. If you want to redirect the user from one controller action to another, you call the RedirectToAction() method.
[http://www.asp.net/Learn/mvc/tutorial-03-cs.aspx]