page.linkUrl + SiteUrl

Vote:
 
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
#15877
Mar 25, 2008 19:07
Vote:
 
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.
#16546
Mar 25, 2008 19:09
Vote:
 
I found it out now. You should use: EPiServer.UriSupport.Combine(
#16547
Mar 25, 2008 19:09
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.