What is ActionResult ?
ActionResult is the abstract class which is used to show the output to the client in different format as per result view returned by the controller.
The ActionResult are defined into the controller and controller returns to the client (Browser).
The following are the subtype or types of Action Results which are present in MVC which are used as per output requirement of client.
- ViewResult - It returns the a specified view to the response stream such as html.
- PartialViewResult - It returns the partial view to the response stream,mostly the partial view call from main view.Its same like as user control in Asp.net.
- EmptyResult - This action returns the empty response to the client.
- RedirectResult -It redirects to the specified url same as Response.Redirect in Asp.net.
- RedirectToRouteResult - Performs an HTTP redirection to a URL that is determined by the routing engine, based on given route data.
- ContentResult -It writes content to the response stream without requiring a view.
- FileContentResult -It returns a file to the client.
- FileStreamResult - This action returns a file to the client, which is provided by a Stream.
- FilePathResult - This action returns a file to the client.
This article is only briefs about the ActionResults so beginners can understand,for more details please read my future article.
Don't Forget To