I don\'t necessarily need to run it at server, however, I would like to use the ~/js/somefile.js syntax.
~/js/somefile.js
Previously, I had just set everything with Absolute
You can get fully what you want by wrapping script tag with asp:ContentPlaceHolder and the you can access it from code behind, for example set will it be executed or not by setting visible property to true or false. Here is the example:
and from code behind:
PrintPreviewBlock.Visible = true;