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 asp.net mvc application?
1. Authorization filters
2. Action filters
3. Result filters
4. Exception filters
Give an example for Authorization filters in an asp.net mvc application?
1. RequireHttpsAttribute
2. AuthorizeAttribute
Which filter executes first in an asp.net mvc application?
Authorization filter
What are the levels at which filters can be applied in an asp.net mvc application?
1. Action Method
2. Controller
3. Application
Is it possible to create a custom filter?
Yes
What filters are executed in the end?
Exception Filters
Is it possible to cancel filter execution?
Yes
What type of filter does OutputCacheAttribute class represents?
Result Filter
Subscribe to:
Post Comments (Atom)
How can we cancel the filter execution?
ReplyDeletepublic class SignInRequiredAttribute : AuthorizeAttribute
Delete{
protected override bool AuthorizeCore(HttpContextBase httpContext)
{
return !Acme.Web.CurrentUser != null;
}
}
Action filter pre and post behavour
ReplyDeleteHow can we cancel the filter execution..................?
ReplyDeleteand how to work in application level filters..............?
How can we cancel the filter execution..................?
ReplyDeleteand how to work in application level filters..............?