Quantcast
Channel: Using Optimizely Platforms
Viewing all articles
Browse latest Browse all 8020

Obtain friendly URL of page

$
0
0

Hello,

I have a PageReference property and I want o obtain the URL to that page. I'm using EpiServer 9.

Initially I was using: EPiServer.Web.Routing.UrlResolver.Current.GetUrl(myPageReference); but this method can return the url in this format “/EPiServer/CMS/Content/mypage,,74/?epieditmode=True”  instead on "/myPage" (when we are in edit mode).

I saw some suggestions to use this: EPiServer.Web.Routing.UrlResolver.Current.GetUrl(myPageReference, null, new EPiServer.Web.Routing.VirtualPathArguments() { ContextMode = EPiServer.Web.ContextMode.Default });, which seems that is working to obtain the frienly URL.

Is this the proper/best way to do it, or is there another method in this Epi version?

Thanks,

Bogdan


Viewing all articles
Browse latest Browse all 8020

Trending Articles