Reputation: 14050
Is there a way in Asp .NET MVC 2 to temporarily disable a controller in ASP .NET Mvc 2? Is there some attribute or web config element that can help me with this?
For reasons that are out of my controll I just cannot comment unwanted controller out.
Upvotes: 1
Views: 2811
Reputation: 39501
Yes there is. Simplest one is to use Custom ActionFilter on your controller that would do some custom action instead of controller actions
Upvotes: 1
Reputation: 184
I guess you could filter it through a route and direct it to a "Sorry" page.
This might help you.
http://odetocode.com/blogs/scott/archive/2009/10/13/asp-net-mvc2-preview-2-areas-and-routes.aspx
Upvotes: 2