VS2010 ASP.NET: How can I set a breakpoint in my Javascript?

I know Javascript breakpoints are possible because I used to do it all the time in my previous job using VS2010. At my new job now, VS tells me it can’t set the breakpoint. Instead, I have to put debugger; in my code and then choose another instance of VS for debugging, but I don’t want to do it that way. It’s much easier to set a breakpoint, attach the debugger to the dev server, and run my code.

Edit: I just thought about it and will add that I was also using Telerik’s RadCodeBlock in the past. Let me look into that more and see if that’s why I was able to set script breakpoints.

  • Javascript debugging: stopping/breaking at every javascript invocation
  • Remove all breakpoints from chrome
  • Can I break with debugger on all changes to a DOM element?
  • Firebug programmatic breakpoint?
  • Why is Chrome pausing on some line inside jQuery?
  • Breakpoint right before page refresh?
  • Remove all breakpoints from chrome
  • Wrong Javascript sourcemap mapping on Visual Studio 2017
  • Breakpoints ignored in Safari 7
  • How to set a breakpoint at a lambda call in Google Chrome DevTools?
  • breakpoint after page reload
  • Firebug v2.0.1 breaking on old breakpoints
  • One Solution collect form web for “VS2010 ASP.NET: How can I set a breakpoint in my Javascript?”

    This only works when you view your website using the build-in webdevserver and view the website in IE. In the solution explorer of VS2010 you will see the dynamically created pages being listed somewhere in the tree. The same holds for the javascript. You can place breakpoints inside these files, which will be picked up by by the debugger. In this way you can debug the javascript just as easily as your other code.