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:

  1. authorization filters
  2. action filters
  3. response filters
  4. 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):

  1. first
  2. global
  3. controller
  4. action
  5. last

extracted msdn


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -