Provides a collection of routes for ASP.NET routing. The RouteCollection class provides methods that enable you to manage a collection of objects that derive from the RouteBase class. 这个类相对而言比较复杂了.支持很多方法和属性,以及扩展方法.下面会记录一些我用过的方法. 在asp.net app中, 启动文件一般…
用于提供一些属性和方法来定义如何将URL匹配到一个物理文件上面. public PageRouteHandler (string virtualPath, bool checkPhysicalUrlAccess); Parameters virtualPath String The virtual path of the physical file of this Route object. The file must be located in the current application.…
Provides a way to specify that ASP.NET routing should not handle requests for a URL pattern. ex: routes.Add(new Route("{resource}.axd/{*pathInfo}", new StopRoutingHandler())); The StopRoutingHandler class enables you to specify that ASP.NET rout…
Provides properties and methods for defining a route and for obtaining information about the route. ex: void Application_Start(object sender, EventArgs e) { RegisterRoutes(RouteTable.Routes); } public static void RegisterRoutes(RouteCollection routes…