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 Blogs - https://code-sample.com and https://code-sample.xyz
My Book1 - BEST SELLING ANGULAR BOOK (INCLUDING ALL VERSIONS 2, 4, 5, 6, 7)
My Book2 - ANGULAR 2 INTERVIEW QUESTIONS BOOK - Both Books are Available on WorldWide.

www.code-sample.com/. Powered by Blogger.
^