Hello
What is the role of action filter in ASP.NET MVC
Action filter in MVC
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Priya LingeRank #785 · 2.9K reputationPosted Dec 14, 2011, 7:19 PM EST
1.An action filter is an attribute that we can apply to a controller action or an entire controller
that modifies the way in which the action is executed.
•OutputCache – This action filter caches the output of a controller action for a specified amount of time.
•HandleError – This action filter handles errors raised when a controller action executes.
•Authorize – This action filter enables you to restrict access to a particular user or role.
2.ASP.NET MVC Action Filter - Caching and Compression
Caching plays a major role in developing highly scalable web applications. We can cache any http get request in the user browser for a predefined time,
if the user request the same URL in that predefined time the response will be loaded from the browser cache instead of the server.
Another important thing is compression. Now a days, all modern browsers accept compressed contents and it saves huge bandwidth.
Please check below link.
http://www.asp.net/mvc/tutorials/older-versions/controllers-and-routing/understanding-action-filters-cs
http://weblogs.asp.net/rashid/archive/2008/03/28/asp-net-mvc-action-filter-caching-and-compression.aspx
Hope this will help you.
Thanks.