Absolute url with language prefix

Vadlamani . asked on January 7, 2021 04:52

Hello Team, I need the absolute url with language prefix , tried with <%# UrlHelper.GetAbsoluteUrl("/company/about") %> but i got the output as "http://domainname.com/company/about" instead "http://domainname.com/en-us/company/about".

we get the relative url from user via configure of widget and it is subject to change in future.

Recent Answers


Vadlamani . answered on January 7, 2021 04:54

Any method that provides the absolute url along with current culture prefix by providing the relative url as parameter?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on January 7, 2021 05:40

LocalizationContext.CurrentCulture.CultureNameshould get you the code like en-us.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.