user3172894 user3172894 - 8 months ago 45
ASP.NET (C#) Question

What are the scenarios where we can use Actionresult in MVC?

I know that actionresult is the base class which is inherited by ViewResult,JsonResult etc. but I want to know under what circumstances we can call ActionResult directly.

Answer Source

When you need to return result based on condition

public ActionResult TestAction()
        return View();