AI OnAI Off
same problem as this post
http://world.episerver.com/Modules/Forum/Pages/thread.aspx?id=33122
Hi Anders,
it looks like the same problem. Meanwhile, a colleague of mine gave me this solution:
UrlBuilder url = new UrlBuilder(UriSupport.AddLanguageSelection(page.LinkURL, page.LanguageID));
return url.ToString();
Hi,
I'm continuing my struggle with EPiServer multi language support starting form here:
http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=51423&epslanguage=en
Now I have a problem from getting correct page URL for a language version in a custom generic handler.
Lets say this is my Generic Handler Code:
/Templates/Handlers/MyTestHandler.ashx
public void ProcessRequest(HttpContext context)
{
...
PageReference testRef = new PageReference(38); //Some page with both english and german versions
LanguageSelector langSelectorTest = new LanguageSelector("de"); //We want german version
PageData test = EPiServer.DataFactory.Instance.GetPage(testRef, langSelectorTest);
//test.LanguageBranch - is de - correct!
//test.LanguageID - is de - correct!
//test.PageName - is german version - correct!
//test.PageLink - is "/SomePath/SomeName.aspx?id=38&epslanguage=en" - Not correct
//Let's try GetPageLanguage version
PageData testAgain = test.GetPageLanguage(langSelectorTest.LanguageBranch);
//testAgain.PageLink - is "/SomePath/SomeName.aspx?id=38&epslanguage=en" - Not correct
...
}
public bool IsReusable
{
get
{
return false;
}
}
For some reason PageLink is returning URL for english version instead of german