I have an ASP.NET MVC Website with a lot of JavaScript inside my views.

I have a few questions:

1. Is it possible to put JavaScript functions in an external .js file (using razor syntax in some functions to get model values)?
2. How can I debug my application? For now I just put some alert() in the code but it is not a good solution.
3. How can I log data? I use log4net for the C# part but is there a way to do it in JavaScript? At least into the "Output" section of Visual Studio.