The fragment @Url.Content("/Scripts/SomeScript.js")
does absolutely nothing, and is equivalent to just /Scripts/SomeScript.js
.
However, for paths starting with "~", it will translate the url to the correct, application relative url, e.g., @Url.Content("~/Scripts/SomeScript.js")
could translate to /MyVirtualDirectory/Scripts/SomeScript.js
, if you deployed your web application to a virtual directory MyVirtualDirectory below the root folder of the web site.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…