What is Filter?

It provides a way to inject extra logic at different levels of ASP.NET MVC framework after the action is executed.

Types of filters

There are five types of filters available in the ASP.NET MVC 5: 1. Authentic ation filters 2. Authorization filters 3. Action filters 4. Result filters 5. Exception filters

Authentication filters

The validity of the user making the request is verified by this filter. All filters and action methods are invoked after the authentication filter.

IAunthenticationFilter

Authorization filters

This filter is used to determine if the user is authorized to access a specific page or resource. For controller activities, these filters were utilized to implement authentication and authorization.

IAuthorizationFilter

Action filters

Depending on the situation, a controller's entire action set or only a specific action can be applied to an action filter. Before or after the action method has finished executing, the action filters in an ASP.NET MVC application will be executed.

IActionFilter

Result filters

These filters have logic that runs both before and after a view result. Consider the case when you wish to alter a view result just before the view is displayed to the browser, this filter is utilized.

IResultFilter

Exception filters

These filters can be used as an exception filters to deal with any unhandled exception brought on by your controller actions or their results.

IExceptionFilter

2X faster apps development !

Syncfusion offers over 1,800 components and frameworks for WinForms, WPF, ASP.NET (MVC, Core), UWP, WinUI, .NET MAUI, Xamarin, Flutter, Blazor, JavaScript, Angular, Vue, and React that make developers’ work easier.