给定以下代码,在我的 ASP.NET 网络表单应用程序中;
void foo(RouteCollection routes){
routes.MapPageRoute(string.Empty, "testroute", "~/hello.aspx", false);
}
问题是,虽然http://localhost/testroute路由到hello.aspx,但http://localhost/testroute/也路由到 hello.aspx。
有没有办法防止这种情况发生?