我正在为我的应用程序使用 URL 路由,并希望防止 URL 路由发生在以人员/开头的任何事情上,但使用以下代码它不起作用,我怎样才能让 ASP.Net 防止 URL 路由接触人员目录它是子目录?
private static void RegisterRoutes(RouteCollection Routes)
{
//URLs to ignore routeing on
RouteTable.Routes.Ignore("staff/");
//Good routes
Routes.MapPageRoute("Reviews", "{Category}/{RouteName}/Reviews.aspx", "~/RouteFiles/Reviews.aspx");
Routes.MapPageRoute("Races", "{Category}/{RouteName}/Races.aspx", "~/RouteFiles/Races.aspx");
Routes.MapPageRoute("SectionHomePage", "{Category}/{RouteName}", "~/RouteFiles/SectionHomePage.aspx");
}