ASP.NET MVC 2 IgnoreRoute in all directories

I switched from MVC 1 to MVC 2. I use file.axd httphandler in my application and I installed routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); into your global routing. Since MVC 2 MVC ignores requests only /file.axd , not before /folder/file.axd.

Any changes to MVC 2?

I just want to make sure that all requests in any folder in any .axd file will be processed by my httphandler.

Thanks!

+4
source share
1 answer
 routes.IgnoreRoute("{*allaxd}", new { allaxd = @".*\.axd(/.*)?" }); 

Thanks HAACKED: http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx

+5
source

Source: https://habr.com/ru/post/1307261/


All Articles