title: ASP.NET: How to get URL of a file?
body: <p>i want to get the fully qualified url to a resource in ASP.NET.</p>
  
  <p>e.g.:</p>
  
  <pre><code>&lt;LINK rel="shortcut icon" href="&lt;%=GetFaviconPath()%&gt;"&gt;
  </code></pre>
  
  <p>with the code-behind file right now containing:</p>
  
  <pre><code>private String GetFaviconPath()
  {
     String url = System.Web.VirtualPathUtility.ToAbsolute("~/Images/clock.ico");
     return url;
  }
  </code></pre>
  
  <p>Unfortunately this doesn't work because it doesn't return the <strong>fully qualified</strong> path, only the path relative to the server:</p>
  
  <pre><code>/Employement/Images/clock.ico
  </code></pre>
  
  <p>Internet Explorer requires a <strong>fully qualified</strong> url, e.g.:</p>
  
  <pre><code>http://localhost:62119/Employment/Images/clock.ico
  
  http://avenger:81/Employment/Images/clock.ico
  
  http://MyFreeAspDotNetHosting.com/IanBoyd/Employment/Images/clock.ico
  </code></pre>
  
  <p>How can i get the fully qualified path to a file? i've tried <code>VirtualPathUtility</code> and i'm all out of ideas.</p>