Top "Action-filter" questions

In ASP.

Calling FilterAttribute's OnActionExecuting before BaseController's OnActionExecuting

I have a BaseController in which I put in some data in the ViewData collection by overriding OnActionExecuting. Now i …

asp.net-mvc action-filter
How to get authenticated user's name, IP address, and the controller action being called from an HTTP Filter?

I'm trying to audit my action events on the controller. I want to keep track of authenticated user's name, his …

c# asp.net-mvc action-filter
Injecting dependency into CustomAttribute using Castle Windsor

In my ASP.Net MVC application I have implemented a Custom ActionFilter to Authorize users. I use CastleWindsor to provide …

c# asp.net-mvc dependency-injection castle-windsor action-filter
How do the httppost, httpput etc attributes in ASP.NET MVC 2 work?

In ASP.NET MVC 2, a couple of new action filter attributes were introduced, as "shorthand" for attributes in ASP.NET …

c# asp.net-mvc-2 action-filter http-method
Capturing HTML output with a controller action filter

I've got the following filter in place on an action to capture the HTML output, convert it to a string, …

c# asp.net-mvc-2 stream controller action-filter
Execute global filter before controller's OnActionExecuting, in ASP.NET Core

In an ASP.NET Core 2.0 application, I am trying to execute a global filter's OnActionExecuting before executing the Controller's variant. …

c# asp.net-core .net-core action-filter
Unity Inject dependencies into MVC filter class with parameters

I'm using Unity.MVC4 dependency injection for accessing my services. Everything works as it should when injecting into my Controller …

asp.net-mvc asp.net-mvc-4 dependency-injection unity-container action-filter
Why call base.OnActionExecuting(filterContext);?

I am just looking at some old code of mine and I have an action filter(OnActionExecuting method) and at …

asp.net-mvc asp.net-mvc-3 action-filter
How-to test action filters in ASP.NET MVC?

Need some pointers for this. Found this and this, but I'm still kind a confused. I just want to mock …

asp.net-mvc testing action-filter
ASP.NET MVC: Call one controller action from another, with ActionFilters applied

Take a look at the code below. When Get() calls Foobar() and Foobaz(), the ActionFilters that decorate Foobar() and Foobaz() …

asp.net-mvc action-filter asp.net-mvc-controller