Greetings,
I am using Visual Studio 2010 and ASP.NET 4.0 to build a WebForms project that uses the new routing features in System.Web.Routing. When I build my solution and run it from within VS.NET's debugging environment only routes with RouteUrl's that include a ".aspx" extension are being properly routed to the PhysicalFile. It appears requests made to other URLs are not being "detected" by the routing engine for processing. In the case below, "Scenario1" shows a 404 and "Scenario2" works properly.
I would greatly appreciate any guidance you can provide.
Here is the relevant code in my global.asax:
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
// Register Routes
RegisterRoutes();
}
void RegisterRoutes()
{
System.Web.Routing.RouteTable.Routes.MapPageRoute("Scenario1", "scenario1/{option1}", "~/About.aspx");
System.Web.Routing.RouteTable.Routes.MapPageRoute("Scenario2", "scenario2.aspx", "~/About.aspx");
}
Thank you kindly for your time.
MomentSurfer