I'm using the new routing functionality in ASP.NET 3.5 to act as my catch-all for page requests to my website. I've registered my route as follows within the global.asax,
<%@ Application Language="C#" %>
<%@ Import Namespace="System.Web.Routing" %>
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
private void RegisterRoutes(RouteCollection Routes)
{
Route r = new Route("{*URL}", new MyRouteHandler());
Routes.Add(r);
}
</script>
The code works absolutely fine for all URLs except / (the root page). If I go to any other URL /blah/something/foo/ it works fine and my handler is run as expected.
How can I get it to run over the root page? I am running the code via Visual Studio 2008's build in web server.