Stop continuation of ASP.NET MVC ActionFilter
action-filter, actionfilterattribute, asp.net, asp.net-mvc
Solution
Setting the `filterContext.Result` property to any non-null value will stop execution of later filters. So if your first filter sets `filterContext.Result = new RedirectResult(...)`, the second filter and action method will never be run. This is how the built-in `[Authorization]` filter works.
Problem
I have two custom ActionFilters on an action. In first of the actionfilters, I have an redirect performed if a condition is not met (classic authorization). And in another I have an redirect performed if another condition is not met (say role checking). But I do not want to continue to the second actionFilter if the first one is not met. How to do this?