internal static void EntryRoutes(RouteCollection routes)
        {
            EntryRoute entryRoute = new EntryRoute("{name}-{id}/",
                                                   new RouteValueDictionary(
                                                       new
            {
                controller = "Home",
                action     = "Content",
                id         = 0,
                name       = string.Empty
            }),
                                                   new RouteValueDictionary(new { id = @"\d+" }),
                                                   new MvcRouteHandler());

            routes.Add("display-entry",
                       entryRoute);

            routes.MapRoute("default-entry",
                            string.Empty,
                            new { controller = "Home", action = "Default" });

            routes.MapRoute("menu-route",
                            "menu/{action}",
                            new { controller = "Menu" });

            routes.MapRoute("home-route",
                            "Home/{action}",
                            new { controller = "Home" });
        }
        internal static void EntryRoutes(RouteCollection routes)
        {
            EntryRoute entryRoute = new EntryRoute("{name}-{id}/",
                                                   new RouteValueDictionary(
                                                       new
                                                           {
                                                               controller = "Home",
                                                               action = "Content",
                                                               id = 0,
                                                               name = string.Empty
                                                           }),
                                                   new RouteValueDictionary(new {id = @"\d+"}),
                                                   new MvcRouteHandler());

            routes.Add("display-entry",
                       entryRoute);

            routes.MapRoute("default-entry",
                            string.Empty,
                            new {controller = "Home", action = "Default"});

            routes.MapRoute("menu-route",
                            "menu/{action}",
                            new {controller = "Menu"});

            routes.MapRoute("home-route",
                            "Home/{action}",
                            new {controller = "Home"});
        }
Esempio n. 3
0
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapRoute("account",
                            "account/{action}",
                            new { controller = "Account" });

            var entryRoute = new EntryRoute("{name}-{id}/",
                                            new RouteValueDictionary(
                                                new
            {
                controller = "Home",
                action     = "Content",
                id         = 0,
                name       = string.Empty
            }),
                                            new RouteValueDictionary(new { id = @"\d+" }),
                                            new MvcRouteHandler());

            routes.Add("display-entry",
                       entryRoute);

            routes.MapRoute("sitemapxml",
                            "sitemap.xml",
                            new { controller = "Syndication", action = "Sitemap" });

            routes.MapRoute("syndication",
                            "{action}/",
                            new { controller = "Syndication" });

            routes.MapRoute("tag", "tag/{tag}/", new { controller = "Home", action = "Tag" });
            routes.MapRoute("general", "{controller}/{action}/{id}",
                            new { controller = "Home", action = "Default", id = UrlParameter.Optional });
            //routes.MapRoute("error",
            //       "{*url}", new {controller = "Error", action = "NotFound"});
        }