Created
April 24, 2020 14:11
-
-
Save ashour/5ecc1129849670e4c3860bdb9aadfaf5 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 Heaventure | |
{ | |
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