VS 2008 JavaScript Debugging
page 2 of 5
by Scott Guthrie
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 25466/ 47

Setting JavaScript breakpoints in ASP.NET pages

One of the annoying things with VS 2005 is that you have to first run your ASP.NET pages before you can set JavaScript breakpoints in them in the debugger.  

VS 2008 makes this much better by adding new support that allows you to set client-side JavaScript breakpoints directly within your server-side .aspx and .master source files:

Figure 1

When you set a breakpoint in your .aspx page like above, VS 2008 will automatically map the breakpoint location to the dynamically generated client HTML that runs in the browser when the page is later executed:

Figure 2

If you add/remove/update the breakpoint locations in the running HTML document, VS 2008 is also now smart enough to perform the reverse mapping and update the breakpoint in the original .aspx or .master source file on the server.  This makes it much easier to get into a nice edit/debug/edit/debug flow as you are iterating on your applications.

Best of all, you can now set both client-side JavaScript breakpoints and VB/C# server-side breakpoints at the same time (even in the same page) and use a single debugger to step through both the server-side and client-side code in a single debug session (which is extremely useful for any AJAX heavy application).

Any JavaScript breakpoints you set will also now by default be saved by VS 2008 when you close the project/solution.  When you open up the project again, the previous locations you set the breakpoints on will still have them enabled. 

View Entire Article

User Comments

Title: Javascript debugging doesn't work on remote desktop   
Name: S Kumars
Date: 2009-05-11 7:51:50 AM
Javascript debugging doesn't work on remote desktop. We work on a remote desktop which is located at client location and while this debugging feature works absolutely fine at local machine in VS 08, it doesn't in remote desktop.
Can anyone tell why?
Title: Doubt in Javascript   
Name: lakshmi
Date: 2009-02-08 11:24:24 AM
hi i am lakshmi working as JuniorAssociate in SankaraSoftware, at present am working under C#asp.net(Visual Studio 2008)
i want to do validation that the textbox should accept only numbers by using javascript
i did all these validation in VS2005 but i am trying this in VS2008 but these validation is not working good
and i dont know why its not working....
can you tell me how to write javascript in VS2008 and how to assign javascript function to textboxes

its very urgent for me please help me sir.......... reply me as soon as possible

my email id is: lakshmi_ramanujam@yahoo.com

Thanks & Regards

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2020 ASPAlliance.com  |  Page Processed at 2020-11-28 5:03:43 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search