Our monthly Virtual Happy Hour is happening this week, Fri Feb 23!

Try our conversational search powered by Generative AI!

Quick switch of language?


I would like to have a link in my menu (.ascx) to different languages so that the link points to the same page (ID). Can't just find a simple way to do <a href=" ???????? " > to achieve this. Good hacks?

Nov 18, 2013 13:47

Here's some sample code: Programmatically switching language branch in EPiServer.


Nov 18, 2013 14:13

Didn't quite get how i can use that info to construct a link...further:

this does not work, why?

CurrentPage.GetPageLanguage("en").LinkURL used on a (eg) finnish page does not produce link to the english page.


Nov 21, 2013 16:56


Try this:

var pageReference = new PageReference(???)
foreach(culture in siteCultures){
  var urlResolver = ServiceLocator.Current.GetInstance<UrlResolver>();
  var url = urlResolver.GetVirtualPath(pageReference, culture);


Nov 21, 2013 17:47
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.