I have a global ActionFilter executing on each ActionResult. Is it possible to detect the ActionResult type (such as a JsonResult vs. an ActionResult) inside the ActionFilter?
For instance, I want the ActionFilter to immediately exit here:
public JsonResult someAjaxAction()
{
}
But I’d like it to do it’s magic here:
public ActionResult PageView()
{
}
Yes, I know I could just use an ActionFilter attribute and decorate the actions I’d like to execute this on, but I’d like to keep it as a global ActionFilter and detect inside the action whether I need to perform the desired work.
1 Answer