Asp.Net MVC 1.0 Action Filters Tips
1.Action Filters Interface
- IAuthorizationFilter
- IActionFilter
- IResultFilter
- IExceptionFilter
2.Action Filters Interface Execute Order
(1).IAuthorizationFilter.OnAuthorization(AuthorizationContext filterContext)
(2).IActionFilter.OnActionExecuting(ActionExecutingContext filterContext)
(3).Action Content
(4).IActionFilter.OnActionExecuted(ActionExecutingContext filterContext)
(5).IResultFilter.OnResultExecuting(ResultExecutedContext filterContext)
(6).IResultFilter.OnResultExecuted(ResultExecutedContext filterContext)
(7).IExceptionFilter.OnResultExecuted(ExceptionContext filterContext)
3.Implement a particular type of filter
(1)If you want to implement a particular type of filter, then you need to create a class that inherits from
System.Web.Mvc.FilterAttribute
class and implements one or more of theIAuthorizationFilter
,IActionFilter
,IResultFilter
, orExceptionFilter
interfaces.(2)Just inherits from ActionFilterAttribute and overwirte the methods.(By default,The ActionFilterAttribute class implements
IActionFilter
andIResultFilter
interface).
转载要求及授权协议:
作者: 零零猪(or)Jiessie327(or)JiessieLiang
出处:http://jiessie327.cnblogs.com/
版权:本文版权归作者所有
转载:欢迎转载,为了尊重作者的劳动成果,在【转载】时请按作者要求,指明文章【出处】或给出【原文链接】,谢谢
================================================================
请遵守署名-非商业性使用-禁止演绎 2.5 中国大陆 License.
================================================================