First thing is to make sure the Internet Explorer breaks for the JavaScript. By default, the script debugging is disabled in IE. To enable this, go to: Tools - Internet Options - Advanced (the Advanced tab in Internet Option dialog box) Under the ’Browsing’ section, uncheck the following item: Disable Script Debugging (Internet Explorer)
With the script debugging enabled, Visual Studio will now step through the JavaScript code as well. If the asp.net application you are debugging has any global JavaScript code, pressing F11 to start the program will break the execution at the very first line of the JavaScript code. From there on, if you keep pressing F11, you will be able to step through every line in the application.
This can be used a great learning tool to understand and maintain a site that you have inherited. This will also be extremely useful in understanding JavaScript intensive applications like FCKEditor or AjaxControlToolkit. These applications also have a large amount of global JavaScript code and set up a whole bunch of global objects before the application starts. With script debugging enabled, you can also click in the margin of JavaScript code to setup breakpoints.