JavaScript is executed on the client side, so it has to be in the page source to be seen by the browser and hence executed. You can store your JavaScript procedures in an external file, but the procedure call(s) will still need to be rendered in the page source. The Google Maps feature has a good example of this.
If you use the Microsoft AJAX Control Toolkit for client side processing, the code will be more obscured in the page source than JavaScript is, but it can still be decoded by a determined user.