There is no way to protect client-side JavaScript. If you want ANY JavaScript to run on the client for client-side functionality, then you'll have to be resigned to that fact. Of course there are ways to obfuscate the code, and putting a link to the source file stops the code from appearing inline in the actual source of the page, but the JavaScript is available via a temp folder anyway, since it has to be on the client to run (this folder would be the temporary internet files folder in Windows).
Running JavaScript on the server is just that -- running it on the server. You'd need to write to an API that accepts JavaScript as a language for that API, like ASP, which you mentioned. This server-side code has nothing to do with any client-side JavaScript, though.
-Tek