MVC ignore request for controller

Go To StackoverFlow.com

2

I have a base controller that I want to be ignored if requested, by using the IgnoreRoute method like this routes.IgnoreRoute("IgnoreThis"); I have been able to match the controller and it is subsequently ignored (returns a 404).

If I enter the following URL http://mysite/IgnoreThis/SomeAction however, the ignored route is no longer matched.

What is the syntax that I need to use in order to use regular expression that matches any route that starts with "IgnoreThis"?

2012-04-04 06:02
by nickbw


3

Try this below.

routes.IgnoreRoute("IgnoreThis/{*pathInfo}");
2012-04-04 06:13
by scartag
Ads