JsonResult

What Are different return types of a controller action method in MVC?

What Are different return types of a controller action method in MVC?
The types of controller action methods -
1.      ViewResult – It is used to renders a specified view to the response stream
2.      PartialViewResult – It is used to renders a specified partial view to the response stream
3.      EmptyResult - It is used to returns an empty response
4.      RedirectResult - It is used to performs an HTTP redirection to a specified URL
5.      RedirectToRouteResult - It is used to performs an HTTP redirection to a URL that is determined by the routing engine, based on given route data
6.      JsonResult - It is used to serializes a given object to JSON format
7.      JavaScriptResult - It is used to returns a piece of JavaScript code that can be executed on the client
8.      ContentResult - Writes content to the response stream without requiring a view
9.      FileContentResult - It is used to returns a file to the client
10.  FileStreamResult - It is used to returns a file to the client, which is provided by a Stream
11.  FilePathResult - It is used to returns a file to the client


You can see how controller action methods works as following-
I hope you are enjoying with this post! Please share with you friends. Thank you!!

ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..

My Tech Blog - https://www.code-sample.com/
My Books - Book 1 and Book 2

What Are different return types of a controller action method in MVC? What Are different return types of a controller action method in MVC? Reviewed by Anil Singh on 3:00 AM Rating: (5)
www.code-sample.com/. Powered by Blogger.
^