开发者

ASP.NET MVC 2 IgnoreRoute in all directories

开发者 https://www.devze.com 2022-12-27 01:55 出处:网络
I s开发者_Go百科witched from MVC 1 to MVC 2. I am using a file.axd httphandler in my application and I set routes.IgnoreRoute(\"{resource}.axd/{*pathInfo}\"); in my global routing. Since MVC 2 MVC onl

I s开发者_Go百科witched from MVC 1 to MVC 2. I am using a file.axd httphandler in my application and I set routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); in my global routing. Since MVC 2 MVC only ignores requests to /file.axd but not to /folder/file.axd.

Any changes in MVC 2?

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

Thanks!


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消