开发者

ASP.NET MVC 2 IgnoreRoute in all directories

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜