Spacy,
I'm curious why you are recommending the physical address?
Ashok,
When you put a resource URL in a .NET property that expects a resource (such as HyperLink.NavigateUrl or Image.ImageUrl, then you can use the following syntax:
~/resourceDir/resource
The ~ character gets replaced with the application root URL. If your web application is called "myapplication" a reference to "~/images/button.gif" will get emitted by ASP.NET like this: "/myapplication/images/button.gif". (This is how it has to work when developing off of a virtual directory of IIS.) If you then move the application to a web host where your website is one of many on the same server then you'll usually reference the site with a root address (
www.mywebsite.com). Now the same image URL will get emitted like this: "/images/button.gif".
The second scenario is a little bit harder to deal with. If you have what amounts to hard coded URLs to resources (i.e. they are not set or bound to properties that expect URLs as mentioned above) then you have to be careful how you emit those. There is a method on the Page class called "ResolveURL()" which will do the ~ resolution for you. Then the situation I described earlier will apply and you won't get broken resources.
The important thing is to NEVER use fully qualified URLs unless they are going to "offsite" resources (such as references to production web services or other sites or their resources).
-
Peter