ASP.Net makes it very easy to write and debug server side code. I’ve found when talking to ASP.Net developers that many of them don’t know that you can debug clent side script with VS.NET too.
This week I was working on a client web site and needed to to write some client-side JavaScript. This reminded me to post a quick how-to on client side debugging.
Steps
- Enable client-side script debugging in Internet Explorer
- Open Microsoft Internet Explorer.
- On the Tools menu, click Internet Options.
- On the Advanced tab, locate the Browsing section, and uncheck the Disable script debugging check box, and then click OK.
- Close Internet Explorer.
- In your JavasSript function add the keyword debugger . This causes VS.NET to switch to debug mode when it runs that line.
- Run your ASP.Net application in debug mode.
That’s all there is to it.
Comments
re: TIP: Debugging JavaScript with Visual Studio.NET 2/13/2006 12:46 PM David Osorno
Hello,
I was looking for an answer in how to debug javascript.
It worked perfectly!!
Thanks very much
re: TIP: Debugging JavaScript with Visual Studio.NET 2/14/2006 11:14 PM Walt Ritscher
Glad it was useful to you. This article has been around for awhile. Did you find it from a search engine?
re: TIP: Debugging JavaScript with Visual Studio.NET 11/9/2006 10:05 PM Jayesh Jadhav
Yes "I" found it from a search engine
re: TIP: Debugging JavaScript with Visual Studio.NET 1/6/2007 8:29 PM Naveen Kumar
It worked for me.. Very useful.. Thanks
re: TIP: Debugging JavaScript with Visual Studio.NET 1/10/2007 8:24 AM Aaron
Consiglio Gestionale Web | hilpers 1/18/2009 6:22 AM Pingback/TrackBack
Consiglio Gestionale Web | hilpers
NUOVI SVILUPPI del debug | hilpers 1/21/2009 10:24 AM Pingback/TrackBack
NUOVI SVILUPPI del debug | hilpers
Hello
What if I cannot insert the debugger statement into the JS code?
Let’s say I want to debug a page that is hosted by another website, so I’m not able to include the debugger statement.
Thanks.