user3172894 user3172894 - 1 year ago 63
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();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download