I have HttpModuleone that intercepts all requests and loads data from a database based on routing rules. However, I run into one problem all the time; GetRouteDataonly works if the path does not exist:
var routeData = RouteTable.Routes.GetRouteData(new HttpContextWrapper(HttpContext.Current));
Assuming a query is being requested for url http://localhost/contact, I get the correct routing data related to this url if this path does not exist on the file system. The problem occurs when I want to configure the page on this url that I am doing by creating an aspx page in the path ~/contact/default.aspx. As soon as I do this, GetRouteDatareturn it null.
I even tried to create a new object HttpContext, but I still cannot get the route data if the page exists.
Has anyone encountered this problem? Is there a solution / workaround?
All help would be greatly appreciated.
source
share