tags:

views:

60

answers:

2

I have a captcha in my MVC application that is called from a HttpHandler (.ashx).

It works fine in Visual Studio developer server.

I just configure in Global.asax:

        public static void RegisterRoutes(RouteCollection routes)
        {    
            routes.IgnoreRoute("{filename}.ashx/{*pathInfo}");//captcha

.........

It ignores the follow path in Visual Studio developer server:

http://localhost:5011/captcha.ashx?id=2342556fgh767896sa

Problem is now i'm running the application in IIS 7.Now the path to be ignored has changed to:

http://localhost/Sce/captcha.ashx?id=2342556fgh767896sa

And it doesn't work anymore.

Any ideas to ignore the new path?

UPDATE:

I´ve solved my problem.Need to add the handler in web.config,but not in <httpHandler> section.Must be in <system.webserver> section cause im using IIS 7.0

+1  A: 

Add the handler to the system.webserver section of your web.config.

Daniel A. White
You were correct im sorry.Thk you!
+1  A: 

How about:

routes.IgnoreRoute("{allashx}", new {allashx=@".*\.ashx(/.*)?"});

Order is important. Put this first before your controller routes.

klabranche
it doenst work.But i guess that its correct.Must be another problem.