I'm trying to change the way our actionresult names appear on the URL.
I tried using [ActionName()]
attribute on the actionresult declaration and modifying routes.Maproute()
parameters in RouteConfig but it just caused application errors. Apparently, I'm missing something or doing it all wrong.
Simply, I'm trying to make the following actionresult appear as "giris" on url.
public ActionResult Login(string returnUrl, string lang = "tr")
{
code code code
}
and this is the part about this actionresult
routes.MapRoute(
"LoginTr",
"login",
new { controller = "Account", action = "Login", lang = "tr" }
);
routes.MapRoute(
"LoginEn",
"en/login",
new { controller = "Account", action = "Login", lang = "en" }
);
Also how can I make the custom url's work for different page languages?