In what order are filters executed in asp.net mvc -
in mvc can decorate action methods different filters like
[httppost] [authorize] public actionresult mymethod(){}
httppost
derives methodselectorattribute
(probably indirectly) , authorize
attribute inherits actionfilterattribute
.
my question is: in order executed in mvc request pipeline? tried go search in mvc source code failed find relevant code bits.
filters run in following order:
- authorization filters
- action filters
- response filters
- exception filters
for example, authorization filters run first , exception filters run last. within each filter type, order value specifies run order. within each filter type , order, scope enumeration value specifies order filters. enumeration defines following filter scope values (in order in run):
- first
- global
- controller
- action
- last
extracted msdn
Comments
Post a Comment