1

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.

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

1

Yes there is. Simplest one is to use Custom ActionFilter on your controller that would do some custom action instead of controller actions

2 Comments

What if along with Custom ActionFilter a controller is decorated with [Authorize] attribute? Isn't it that for a client accessing the controller in question first login page is displayed and only after successful login my Custom ActionFilter is hit? Thats not quite what I'm looking for...
That is what you are looking for. FilterAttribute (Base of ActionFilter) has got an Order property by which you can set order of your filter attributes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.