Sunday, June 3, 2012

MVC Interview Questions on Filters

What is the use of action filters in an MVC application?
Action Filters allow us to add pre-action and post-action behavior to controller action methods.

If I have multiple filters impleted, what is the order in which these filters get executed?
1. Authorization filters
2. Action filters
3. Response filters
4. Exception filters

What are the different types of filters, in an mvc application?
1. Authorization filters
2. Action filters
3. Result filters
4. Exception filters

Give an example for Authorization filters in an mvc application?
1. RequireHttpsAttribute
2. AuthorizeAttribute

Which filter executes first in an mvc application?
Authorization filter

What are the levels at which filters can be applied in an mvc application?
1. Action Method
2. Controller
3. Application

Is it possible to create a custom filter?

What filters are executed in the end?
Exception Filters

Is it possible to cancel filter execution?

What type of filter does OutputCacheAttribute class represents?
Result Filter

1 comment:

  1. MVC is a framework pattern that splits an application’s implementation logic into three component roles: models, views, and controllers.mvc interview questions