Click here to Skip to main content
15,902,870 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
 Posted 4 days ago
I have to do for static areas with Resource File.

For example Its changing menu name but I wanna change url name. How can I do.

<a href="@Url.Action(@dil.Resource.Home, "Index","Home")">@dil.Resource.Home</a>

I want to do.

When I click english change url for example www.sitename.com/en/aboutus when I click turkish change urlwww.sitename.com/tr/hakkimizda


I want to do exactly like below link. But How can I do simple way ? Is this possible ?

https://blog.learningtree.com/localizing-asp-net-mvc-routesurls/


What I have tried:

C#
routes.MapRoute(
  name: "Contact",
  url: "{language}/contactus",
defaults: new { language = lang, controller = "Contact", action = "Contact" });
 
 
 
      routes.MapRoute(
          name: "Default",
          url: "{language}/{controller}/{action}/{id}",
          defaults: new { controller = "Home", action = "Index", language = lang, id = UrlParameter.Optional },
          namespaces: new string[] { ".Controllers" }
 
      );
Posted
Comments
Member 12859772 5-Aug-18 8:25am    
Can anyone help me ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900