What is the difference between ActionResult and ViewResult?

Hi Everyone,
What is the  major difference between ActionResult and ViewResult in MVC. Please can anyone give me a some striking differences.

Thank you.
Last updated:2/7/2016 11:24:35 PM

1 Answers

Anupam Mishra
Anupam Mishra

ActionResult is an abstract class while ViewResult derives from the ActionResult class. ActionResult has several derived classes like ViewResult, JsonResult, FileStreamResult, and so on.
ActionResult can be used to exploit polymorphism and dynamism. So if you are returning different types of views dynamically, ActionResult is the best thing. For more details you Click Here

Answer