title: Absolute paths for CSS files in ASP.net
body: <p>I had an error in my asp website when I deployed it to IIS6 telling me that I <em>cannot use a leading .. to exit above the top directory</em>. I searched around google and viewed similar questions posted here at stackoverflow and saw recommendations to replace my relative paths <strong>...</strong> with <strong>~</strong>.</p>
  
  <p>Here is the path for my CSS folder:
  <code>LMS\assets\css</code>
  <br>
  Where the page is located that tries to access the CSS:
  <code>LMS\MasterPages</code> <br>
  My project structure:<br>
  <code>LMS</code><br>
  &nbsp;&nbsp;-->assets <br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->css <br>
  &nbsp;&nbsp;-->MasterPages <br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->Default.aspx</p>
  
  <p>However, I can't seem to get my paths working. My Default.aspx cannot find my CSS file. Here is an example: <br>
  <strong>Working:</strong><code>&lt;link href="../assets/css/globalStyles.css" rel="stylesheet" runat="server"/&gt;</code>
  <br><br>
  <strong>Alt 1:</strong><code>href="~/assets/css/globalStyles.css"</code> <br>
  <strong>Alt 2:</strong><code>href="~\\assets\\css\\globalStyles.css"</code> <br>
  <strong>Alt 3:</strong><code>href="&lt;%= Page.ResolveUrl("~/assets/css/globalStyles.css") %&gt;"</code>
  <br><br>All of these alternatives don't work. When I debug my site, no styles are present and all are just plain texts. Google Chrome pointed out that my path was being read incorrectly. It was read as:<br>
  <code>http://localhost:2981/LMS/Admin/~/assets/css/globalStyles.css</code>. <br></p>
  
  <p><br>Can share some thoughts on why this is happening? Why can't my page find my CSS files? I even tried to bind the Page Header in page load but its still not working.</p>
  
  <p>Some ideas? Any help will be greatly appreciated!</p>