Filters


ASP.NET MVC provides a simple way to inject your piece of code or logic either before or after an action is executed. This is achieved by decorating the controllers or action with ASP.NET MVC attributes or custom attributes.An attribute or custom attribute implements the ASP.NET MVC filters and can contain your piece of code or logic.

Using Filters

When i applied authorization to the action methods of the SportsStoe administration controller. Iwanted the action method to be used only by users who had authenticated themselves. which presented me with a choice of approaches. I could have checked the authorization status of the request in each and every action method.

Filter Type

     • Authorization

     • Action

     • Result

     • Exception