Server.RouteConfig.RegisterRoutes C# (CSharp) Méthode

RegisterRoutes() public static méthode

public static RegisterRoutes ( RouteCollection routes ) : void
routes RouteCollection
Résultat void
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            /*
            routes.MapRoute(
                "post",                                           // Route name
                "post/{postID}/{action}",                            // URL with parameters
                new { controller = "post", action = "Index" }  // Parameter defaults
            );
            */
            /*
            routes.MapRoute(
                "Post",                                           // Route name
                "post/{postID:int}",                            // URL with parameters
                new { controller = "Post", action = "Index", postID = UrlParameter.Optional }
            );
            */
            routes.MapMvcAttributeRoutes();

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
    }
RouteConfig