tags:

views:

60

answers:

0

How to ignore a route inside an area?

I have captcha in my MVC application.It loads its image from an GenericHanlder(.ashx),so if imnot using areas it works fine, if I just ignore routes from that URL.

i.e: In Global.asax

routes.IgnoreRoute(Counts/{filename}.{ashx}/{*pathinfo});//Counts is the controller name without an area

The problem is that recently I migrated the files to a different area and the path of the route to be ignored was modified.Now its:

Admin/Acounts/Users/captcha.ashx?guid=3565465689789hfghfdf

So i try to change that path in routes.IgnoreRoutes method in Global.asax:

routes.IgnoreRoute(Admin/Acounts/Users/{filename}.ashx/{*pathinfo});

But it doesnt work anymore.Ive already try to ignore that route in RegisterArea method,in AreaRegistrationFile:

    context.Routes.IgnoreRoute("Admin/Accounts/Users/{filename}.ashx/{*pathinfo}");

But that also doenst work.

Any ideas how to ignore routesto an Area?