Is it possible to figure out the currently executing controller/action in OnActionExecuting?
See Question&Answers more detail:osIs it possible to figure out the currently executing controller/action in OnActionExecuting?
See Question&Answers more detail:osYou could try the ActionDescriptor
of the ActionExecutingContext
as follows:
protected override void OnActionExecuting(ActionExecutingContext filterContext)
{
string actionName = filterContext.ActionDescriptor.ActionName;
string controllerName = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName
.....
base.OnActionExecuting(filterContext);
}