Last active
April 23, 2020 12:36
-
-
Save ashour/002d642751fa38911d408e0c6798ddc9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.Mvc; | |
using System.Web.Routing; | |
namespace I18nDemo | |
{ | |
public class RouteConfig | |
{ | |
public static void RegisterRoutes(RouteCollection routes) | |
{ | |
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | |
routes.MapRoute( | |
name: "Root", | |
url: "", | |
defaults: new { | |
controller = "Base", | |
action = "RedirectToLocalized" } | |
); | |
routes.MapRoute( | |
name: "Default", | |
url: "{culture}/{controller}/{action}/{id}", | |
defaults: new { | |
culture = "en", | |
controller = "Home", | |
action = "Index", | |
id = UrlParameter.Optional }, | |
constraints: new { culture = "en|ar" } | |
); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment