I have the following route:
routes.MapRoute(
"Default", // Route name
"{language}/{controller}/{action}/{id}",
new { language = "en", controller = "XY", id = UrlParameter.Optional }
);
For changing the language of the site, I would like to create links, which correspond exactly to the url of the current page, but have another language part.
What would be the best way, to generate such a link?
You could do something like this:
It would probably make sense to make an extension method to handle this though.