I'm trying to debug javascript code just by adding a breakpoint in VS2008, but the debugger's not stopping. Do I have to do some special setup in order to enable javascript debugging? Or does the code have to be in a separate js file?
Any particular browser? Mainly it works with IE, and needs script debugging enabled in the IE internet options (advanced => browsing).
Try this tutorial: http://www.berniecode.com/blog/2007/03/08/how-to-debug-javascript-with-visual-web-developer-express/
I don't know about VS2008, but I know I've never been able to get the debugger to stop on a breakpoint in an aspx (as opposed to a linked js file).
If you are not running this in a project, but just debugging on the fly, be sure to attach to the browsers' process.
I know it's not what you asked, but I gotta plug Firebug for JS debugging, including breakpoints, watch statements, stepping, and a live JS console.
Did you uncheck the checkboxes in the settings
Tools-->Internet Options-->Advanced-->Browsing [heading]-->Uncheck "Disable Script Debugging (Internet Explorer)" and Uncheck "Disable Script Debugging (Other)"
Sometimes you need to restart the browser to get VS2008 to recognize that it has made some changes.
Have you tried to stick the "debugger;" keyword into your JavaScript file? This usually never fails me.
If you have IE8, you can debug right in the browser itself.