title: ASP.Net MVC How to render script elements?
body: <p>Could anyone explain me the difference between:</p>
  
  <p><code>&lt;script src="/Scripts/custom.js"&gt;&lt;/script&gt;</code></p>
  
  <p>and (added tilde symbol)</p>
  
  <p><code>&lt;script src="~/Scripts/custom.js"&gt;&lt;/script&gt;</code></p>
  
  <p>and</p>
  
  <p><code>@Scripts.Render("~/Scripts/custom.js")</code></p>
  
  <p>within an ASP.NET MVC application (mainly in Razor View code)?</p>
  
  <p>I am <a href="https://stackoverflow.com/questions/17701781/what-is-the-difference-between-script-render-and-script">aware</a> that usually <code>@Scripts.Render</code> is used for bundling and minifying scripts. As you can see in my third example, I am not using <code>@Scripts.Render("~/bundles/*")</code> on purpose because I am not making this question look like question that is about bundling. I would like to know what the best way would be for rendering (page specific) scripts. Is there any other significant reason to use one before another?</p>