Vulnerability in EPiServer.Forms

Try our conversational search powered by Generative AI!

Friendly URL in code behind


I can't seem to figure out how to print the friendly URL of a page in code behind. I need to be able to render it without adding it to the markup. Has anyone got a function that does this?

Aug 24, 2011 16:07

Never mind, I found this one. :)

public string FriendlyURL(PageReference PageLink, string URL)
    var url = new UrlBuilder(URL);
    EPiServer.Global.UrlRewriteProvider.ConvertToExternal(url, PageLink, System.Text.UTF8Encoding.UTF8);
    return url.Uri.AbsoluteUri;

Edited, Aug 24, 2011 16:25
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.