When you work with the LinkURL property in the PageData object in EPiServer, the Url will always be set to the current language. If you are working with a multi-language website, however, sometimes you need to create links to different languages dynamically.
In order to generate a link to a specific language, you can use one of the following methods:
var swedishLink = EPiServer.UriSupport.AddLanguageSelection(page.LinkURL, "sv");
var swedishLink = EPiServer.UriSupport.AddLanguageSelection(page.LinkURL, page.LanguageID);
Software Architect, Programmer and Technologist Jon Jones is founder and CEO of London-based tech firm Digital Prompt. He has been working in the field for nearly a decade, specializing in new technologies and technical solution research in the web business. A passionate blogger by heart , speaker & consultant from England.. always on the hunt for the next challenge