Global action filter in ASP.NET MVC -


is possible create global action filter automatically apply actions in controllers in asp.net mvc application? want "before_filter" defined in applicationcontroller in ruby on rails.

thank help.

this depends want it. in many scenarios, previous answers vucetica , adeel want do. however, neither of them meet criteria listed: automatically apply all actions/controllers.

to that, need implement handler application beginrequest event in global.asax. see msdn documentation more information.

update - july 27, 2010: scottgu blogged about mvc 3 preview 1, includes framework global filters you're talking about. they're registered via global.asax, , can apply controllers or based on specific criteria.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -