url routing catch-all not workin
I am routing all requests myself. I have written the pattern as follo开发者_JS百科ws:
RouteTable.Routes.Add(new Route("{*all}", new URLRouter()));
But when request for www.example.com/styles/site.css arrive, it is not caught by URLRouter handler.
Thank you.
What IIS version is installed? Looks like static file requests are not even reach ASP.NET ISAPI filter. This is default behavior in IIS6 and IIS7 Classic mode application pool.
Update: Set runAllManagedModulesForAllRequests="true"
in Web.config (modules section)
I have solved the issue. The issue appeared that all requests were passing to my URLRouter handler but the request for static contents (such as styles/site.css) are not collected by url-parameter-variable "all" in "{*all}", and all was containing null, although strange thing is that, this request was contained in requestContext.HttpContext.Request.Url. So, I am using requestContext.HttpContext.Request.Url than url-parameter-variable "all".
精彩评论