Hi,
I have a site that supports localization. I would like to be able to switch between english and french.
Let say the user is currently at URL: http://www.mysite.com/en/Home
I would like to redirect to: http://www.mysite.com/fr/Home
If the user click on a "French" link how to change the URL part to "fr" yet not change the "Home" part of the URL (basically I want preserve the current location of the user)
Hope my question makes sense! I'm probably missing something very basic?
EDIT: Kind of found a solution.
<%= Html.ActionLink("Français", ViewContext.RouteData.Values["action"].ToString(), ViewContext.RouteData.Values["controller"].ToString(), new { culture = "fr" }, null)%>
<%= Html.ActionLink("English", ViewContext.RouteData.Values["action"].ToString(), ViewContext.RouteData.Values["controller"].ToString(), new { culture = "en" }, null)%>
This maintains the action/controller of the current URL. Maybe there's a cleaner solution?