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

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

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

unit testing - How to mock PreferenceManager in Android? -