Action Results in Asp.Net MVC ? How Many Type with Examples
Different Types of Action Results in Asp.Net MVC with Examples:
Action Results in Asp.Net MVC:
An ActionResult in asp.net mvc is an Abstract class and ActionResult is return type of controller method. Each ActionResult return different type of result. If we want to display image in Webforms we need to create Imagehandler for it but in Asp.net MVC we can use FileResult which is already built in method.
Whenever we create a empty controller in MVC we have default ActionResult method created with name Index and it returns View(); but we do not have only Return View() option but various other also lets have a look at it.
Types of Action Results in Asp.Net MVC
Following are the list of action results available in asp.net mvc
- ContentResult
- EmptyResult
- FileResult
- JavaScriptResult
- JsonResult
- PartialViewResult
- RedirectResult
- RedirectToRouteResult
- ViewResult
Comments
Post a Comment