How to specify path relative to site root?
<p>i want to specify a path to a file relative to the root of the web-site. e.g.</p>

<pre><code>&lt;script type="text/javascript" src="/Scripts/jquery-1.7.2.min.js"&gt;&lt;/script&gt;
</code></pre>

<p>In ASP.net that causes problems because the <em>"root"</em> of the <strong>site</strong> can be different from the root of <strong>server</strong>.</p>

<p>e.g. Specifying <code>src</code> results in a <code>GET</code> from path</p>

<pre><code>src="/Scripts/jquery-1.7.2.min.js"
http://localhost:64276/Scripts/jquery-1.7.2.min.js                           404

src="~/Scripts/jquery-1.7.2.min.js"
http://localhost:64276/WebSite/Adminstration/~/Scripts/jquery-1.7.2.min.js   404

src="~Scripts/jquery-1.7.2.min.js"
http://localhost:64276/WebSite/Adminstration/~Scripts/jquery-1.7.2.min.js    404

src="~/Scripts/jquery-1.7.2.min.js" runat="server"
500 Unexpected character '$'
</code></pre>

<p>How can i specify a <strong>site relative</strong> path when using HTML in ASP.net?</p>

<h2>See also</h2>

<ul>
<li><a href="http://stackoverflow.com/questions/9700260/how-to-set-the-site-root-relative-path-for-localhost-on-iis-on-my-web-applicat">How to set the Site-Root Relative Path (for localhost) on IIS on my web application</a></li>
<li><a href="http://stackoverflow.com/questions/4571755/asp-net-relative-path">ASP.NET relative path</a></li>
<li><a href="http://stackoverflow.com/questions/7960094/relative-path-from-site-root">Relative path from site root</a></li>
<li><a href="http://stackoverflow.com/questions/200863/jquery-visual-studio-error-cs1056-unexpected-character">JQuery: Visual studio, error CS1056: Unexpected character &#39;$&#39;</a></li>
</ul>
