Esempio n. 1
0
 public void RegisterRoutes(System.Web.Routing.RouteCollection routes)
 {
     routes.MapLocalizedRoute(name: "HomePage",
                              url: "homepage/",
                              defaults: new { controller = "Home", action = "Index" },
                              namespaces: new[] { "mine.web.Controllers" });
     routes.MapLocalizedRoute("Search",
                              "boards/search",
                              new { controller = "Boards", action = "Search" },
                              new[] { "mine.web.Controllers" });
     routes.MapLocalizedRoute("ForumGroupSlug",
                              "boards/forumgroup/{id}/{slug}",
                              new { controller = "Boards", action = "ForumGroup", slug = UrlParameter.Optional },
                              new { id = @"\d+" },
                              new[] { "mine.web.Controllers" });
     routes.MapLocalizedRoute("ForumSlug",
                              "boards/forum/{id}/{slug}",
                              new { controller = "Boards", action = "Forum", slug = UrlParameter.Optional },
                              new { id = @"\d+" },
                              new[] { "mine.web.Controllers" });
     routes.MapLocalizedRoute("TopicSlug",
                              "boards/topic/{id}/{slug}",
                              new { controller = "Boards", action = "Topic", slug = UrlParameter.Optional },
                              new { id = @"\d+" },
                              new[] { "mine.web.Controllers" });
     //change currency (AJAX link)
     routes.MapLocalizedRoute("ChangeCurrency",
                              "changecurrency/{customercurrency}",
                              new { controller = "Common", action = "SetCurrency" },
                              new { customercurrency = @"\d+" },
                              new[] { "mine.web.Controllers" });
     //change language (AJAX link)
     routes.MapLocalizedRoute("ChangeLanguage",
                              "changelanguage/{langid}",
                              new { controller = "Common", action = "SetLanguage" },
                              new { langid = @"\d+" },
                              new[] { "mine.web.Controllers" });
     //customer account links
     routes.MapLocalizedRoute("CustomerInfo",
                              "customer/info",
                              new { controller = "Customer", action = "Info" },
                              new[] { "mine.web.Controllers" });
     //logout
     routes.MapLocalizedRoute("Logout",
                              "logout/",
                              new { controller = "Customer", action = "Logout" },
                              new[] { "mine.web.Controllers" });
     //login
     routes.MapLocalizedRoute("Login",
                              "login/",
                              new { controller = "Customer", action = "Login" },
                              new[] { "mine.web.Controllers" });
     //register
     routes.MapLocalizedRoute("Register",
                              "register/",
                              new { controller = "Customer", action = "Register" },
                              new[] { "mine.web.Controllers" });
     //private messages
     routes.MapLocalizedRoute("PrivateMessages",
                              "privatemessages/{tab}",
                              new { controller = "PrivateMessages", action = "Index", tab = UrlParameter.Optional },
                              new[] { "mine.web.Controllers" });
     //wishlist
     routes.MapLocalizedRoute("Wishlist",
                              "wishlist/{customerGuid}",
                              new { controller = "ShoppingCart", action = "Wishlist", customerGuid = UrlParameter.Optional },
                              new[] { "mine.web.Controllers" });
     //shopping cart
     routes.MapLocalizedRoute("ShoppingCart",
                              "cart/",
                              new { controller = "ShoppingCart", action = "Cart" },
                              new[] { "mine.web.Controllers" });
 }