title: Managing relative paths to css/js files in ASP .NET Master Page
body: <p>in my master page I have</p>
  
  <pre><code>&lt;script src="js/jquery-1.7.1.min.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>and plenty other script/link elements. That works fine if rendered page in on the same level as master page file. If I try to access page that is in subfolder, request to js/css files is wrong.</p>
  
  <p>I tried:</p>
  
  <pre><code>&lt;script src="/js/jquery-1.7.1.min.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>but it only works if there's no application virtual path. If my application is located under:</p>
  
  <pre><code>http://localhost/virtualPath/subfolder/Page.aspx
  </code></pre>
  
  <p>then request goes to:</p>
  
  <pre><code>http://localhost
  </code></pre>
  
  <p>I tried to use ResolveClientUrl, but my head is defined as </p>
  
  <pre><code>&lt;head runat="server"&gt;
  </code></pre>
  
  <p>so I get an error. Is there a way to nicely solve that issue?</p>
  
  <p>Note: I can't remove runat from head tag as I'm using themes</p>