If I have a standard AXD HttpHandler and the default ignore route for *.axd, then why is ASP.NET MVC still handling requests in subdirs, for instance if there is a request made for **/Content/Css/**css.axd?d….
If the request is made at root /css.axd?d…. everything works fine.
Asp – HttpHandlers with ASP.NET MVC
asp.net-mvc
Related Topic
- C# – How to handle multiple submit buttons in ASP.NET MVC Framework
- Asp.net-mvc – How to properly handle 404 in ASP.NET MVC
- Asp.net-mvc – How to get ELMAH to work with ASP.NET MVC [HandleError] attribute
- Asp.net-mvc – ASP.NET MVC – Set custom IIdentity or IPrincipal
- .net – How to get the webapp’s base URL in ASP.NET MVC
- C# – File Upload ASP.NET MVC 3.0
- C# – Returning a file to View/Download in ASP.NET MVC
- C# – Do asynchronous operations in ASP.NET MVC use a thread from ThreadPool on .NET 4
Best Answer
I guess the route was deliberately made like that by design, maybe because the wildcard at a start of string isn't as performant.
Unfortunately this won't work:
The solution is to use constraints - see Phil Haack's blog post
Phil's blogs uses a regular expression constraint, but you could create you own custom contraint alternatively to make things more readable: