Jim Geurts
Jim Geurts

Reputation: 20419

Asp.Net MVC: Is there support for controller level filter attributes?

I have a filter attribute that I'd like to be applied to every action on my controller. Is there a built in mechanism to support this? Right now, I'm manually adding the filter to each action, but that's error prone and tedious. If there isn't support for controller level filter attributes, is there a better way to perform the logic?

Upvotes: 3

Views: 837

Answers (1)

Brad Wilson
Brad Wilson

Reputation: 70586

Apply the filter attribute to the controller class.

Upvotes: 7

Related Questions