Difference Between Viewresult() and ActionResult() / different ActionResult types - in asp.net mvc 3 | Coding Cluster - using asp.net, c#, mvc 4, iphone, php, ios, javascript, in asp.net mvc 3 & more
 

Difference Between Viewresult() and ActionResult() / different ActionResult types - in asp.net mvc 3

Sunday

Types of ASP.NET MVC 3 Action Results: 
                                         ActionResult is the general base class that all the other results are derived from like ViewResult,JsonResult and so on. ActionResult is an abstract class that can have several subtypes.
Here's a description of different ActionResult types in MVC 3


ViewResult - Renders a specifed view to the response stream

PartialViewResult - Renders a specifed partial view to the response stream

EmptyResult - An empty response is returned

RedirectResult - Performs an HTTP redirection to a specifed URL

RedirectToRouteResult - Performs an HTTP redirection to a URL that is determined by the routing engine, based on given route data

JsonResult - Serializes a given ViewData object to JSON format

JavaScriptResult - Returns a piece of JavaScript code that can be executed on the client

ContentResult - Writes content to the response stream without requiring a view

FileContentResult - Returns a fle to the client

FileStreamResult - Returns a fle to the client, which is provided by a Stream

FilePathResult - Returns a fle to the client

This way you can return multiple types of results

Please share this post with your friends. If it's useful to you. Thanks!.

0 comments:

Post a Comment

Share your thoughts here...

 
 
 

RECENT POSTS

Boost

 
Blogger Widgets