In 4.61 to get a complete URL to a page you could prepend LinkURL with EPiServer.Global.EPConfig.HostUrl.
In 5 I tried to do the same thing but with settings.instance.SiteUrl instead and I ended up with a double-slash problem. (http://epi5Test//Templates/Public/Pages/Page.aspx?id=15).
Is there any "nice" way to solve this. Of course you can solve it with trimming the strings but it does not feel good.
/Henrik
Hi Henrik!
I found some information from an article that does not seem to be published at the moment. Hope that this will help you:
- Avoid direct string manipulation. If you want to concatenate two physical paths, use System.lO.Path.Combine - NOT '+'. Check out the types System.IO.Path, System.Web.VirtualPathUtility, System.Uri and System.UriBuilder etc. Always try to find a framework method to manipulate your resource locator - do NOT try to parse or build them by hand if it can be avoided.