title: Using scripts in a master page with ASP.NET MVC
body: <p>I'm fairly new to ASP.NET MVC, and I'm having a little trouble with scripts... in particular, I want to use jQuery in most pages, so it makes sense to put it in the master page. However, if I do (from my <code>~/Views/Shared/Site.Master</code>):</p>
  
  <pre><code>&lt;script src="../../Scripts/jquery-1.2.6.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Then that is literally what goes down to the client - which of course only works if our current route happens to have the right number of levels. Starting with <code>~/Scripts/...</code> doesn't work. Starting with <code>/Scripts/...</code> would only work if the project was at the site root (which I don't want to assume).</p>
  
  <p>I have one working approach (I'll post below) - but: am I missing something?</p>
  
  <p>I'd rather not have to involve a script-manager, as that seems to defeat the simplicity of the ASP.NET MVC model... or am I worrying too much?</p>
  
  <p>Here's the way I can get it working, which works also for non-trivial virtuals - but it seems over-complicated:</p>
  
  <pre><code>&lt;script src="&lt;%=Url.Content("~/Scripts/jquery-1.2.6.js")%&gt;" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>