1
Ich habe zwei Bereiche in meinem Projekt, Admin
und Client
.C# ASP.NET MVC Mehrere Sprachen auf Front-und Admin-Bereich
RouteConfig.cs
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{language}/{controller}/{action}/{id}",
defaults: new { language = "en-US", controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new[] { "Testing.Controllers" }
);
}
Aktuelle Ergebnisse:
[✓] localhost
[✓] localhost/en-us
[✓] localhost/zh-hk
[✗] localhost/admin
[✗] localhost/client
ich hoffe ich etwas tun kann:
localhost - Home Page (Default Language)
localhost/en-us - Home Page (English)
localhost/zh-hk - Home Page (Traditional Chinese)
localhost/admin/en-us - Admin Area Home Page (English)
localhost/admin/zh-hk - Admin Area Home Page (Traditional Chinese)
localhost/client/en-us - Client Area Home Page (English)
localhost/client/zh-hk - Client Area Home Page (Traditional Chinese)
haben Sie Route für Gebiet registrieren? – programtreasures