Could anyone explain me the difference between:
<script src="/Scripts/custom.js"></script>
and (added tilde symbol)
<script src="~/Scripts/custom.js"></script>
and
@Scripts.Render("~/Scripts/custom.js")
within an ASP.NET MVC application (mainly in Razor View code)?
I am aware that usually @Scripts.Render
is used for bundling and minifying scripts. As you can see in my third example, I am not using @Scripts.Render("~/bundles/*")
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?