Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Global.asax
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes (RouteCollection routes)
{
routes.IgnoreRoute ("{resource}.axd/{*pathInfo}");
string defaultCulture = LocalizationConfig.FallbackCulture;
routes.MapRoute (
"DefaultWithCulture", // Route name
"{culture}/{controller}/{action}", // URL with parameters
new { controller = "Home", action = "Index", culture = defaultCulture }, // Parameter defaults
new { culture = new SupportedCultureRouteConstraint () }
);
routes.MapRoute (
"Default", // Route name
"{controller}/{action}", // URL with parameters
new { controller = "Home", action = "Index", culture = defaultCulture } // Parameter defaults
);
routes.MapRoute (
"Home", // Route name
"Default", // URL with parameters
new { controller = "Home", action = "Index", culture = defaultCulture } // Parameter defaults
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.