views:

21

answers:

1

I have an ASCX component that has a lot of javascript declared in a script tag in the ascx itself. I can set breakpoints, and the debugger stops as it should, but the text that is highlighted in the debugger as the "current line" is nowhere near the actual javascript (it is much higher in the rendered file than it should be). I can "wing it" for one or two lines with the real code side-by-side with the "false" line of execution, but I lose all the hover abilities and everything else that makes javascript debugging useful.

I have tried putting the script at the top of my ascx file, but to no avail. I've tried not setting a breakpoint until the entire page is rendered, so that I have to scroll all the way to where the actual lines of code are, and the debugger still stops somewhere way above it.

Has anyone else seen this or no how to get around it?

Please don't answer with suggestions about using a different browser. This site doesn't work except in IE7 and IE8.

Thanks!

A: 

Move the script to an external JS file.
(This is good practice anyway)

SLaks
I agree this is good practice, and it was my first thought as well, but the javascript in question makes extensive use of ASP.Net's <%= whataver %> substitutions. I could change all this and move the script, but I shudder to think the new bugs I'll introduce by doing so.
Craig