AI OnAI Off
The question is what you want to do with the property data. If you simply output it on a page as for example a href it will "automagically" be rewritten by a httphandler. If you want to work eith the url in the codebehind only you can do something like this
UrlBuilder url = new UrlBuilder((string)CurrentPage["MyUrlProperty"])
EPiServer.Global.UrlRewriteProvider.ConvertToExternal(url, null, Encoding.UTF8);
string friendly = url.Uri.OriginalString
If you have the PageReference to the page you should pass that instead of null in the example above.
Ah okay. Yeah that's what I was trying to avoid!
I'll give that a shot.
Thanks very much for your help, appreciated as always!
Karl.
Hi,
You may be seeing quite a bit of me at the moment!
I have added a property to a pagetype of type "URL to page/external address". I then went to edit a page of that pagetype, and chose to link to an internal page.
The trouble with this is that it's inputting the RAW URL into the field when I've selected a page. So I'm getting something like:
/Templates/Public/Pages/Page.aspx?id=53
The trouble with is is that I'd like the re-written version instead.
Is it supposed to save the raw URL like this?
Thanks very much,
Karl.