SiteMap, IFD/OnPremise and relative URLs
I don’t know if you've already faced this problem: When you develop a web page that you want displayed via the SiteMap Navigation, the URLs called are different depending whether you are in OnPremise or IFD mode. In IFD, you get a URL like http://organization_name.domain.extension/ISV/default.aspx In OnPremise, it will look like http://organization_name.domain.extension/organization_name/ISV/default.aspx I assume that you use the same URL to access both Dynamics CRM authentication mode. Now, if you want to use relative URLs to load images, scripts or other (which are also contained in the ISV folder), you're facing a problem: how to use relative URLs to be valid for both IFD and OnPremise mode? The simplest answer, which is often found on the forums, is: Use absolute URLs. Certainly, but this is not very clean to use hard coded server names. So I propose you my method. Maybe not the best but it does the job (even if, as we shall see, it still uses absolute URL). In the code beh...