1

In stackoverflow here and here I found ways to add breakpoint in every method of a class. But I can't find a way to add a break point to every method of a jquery/javascript file.

This is exactly what I am trying to achieve. When I click on a checkbox in a custom control gridview (asp.net) , the entire row gets highlighted. When viewing the generated HTML, the row is nested under many other elements with their own ids and classes. There is some jquery code possibly within this 500kb jquery file, that subscribes to some event of one of the tags, either based on id or class. If I find a way to add a breakpoint to every method, I can pin point which method is responsible for highlighting the row.

(What I have gathered by looking at the generated HTML is that, a jquery function assigns a css class to the selected row)

Community
  • 1
  • 1
developer747
  • 15,419
  • 26
  • 93
  • 147

1 Answers1

1

Here is a link for how to debug javascript within Visual Studio:

http://weblogs.asp.net/scottgu/archive/2007/07/19/vs-2008-javascript-debugging.aspx

However, setting a break-point on every single method and waiting for one of them to hit is not the correct way to do debugging. You should focus on the events which are fired after the row is selected. You can do this by looking at the javascript which was written to interact with the gridview.

One place to start would be to look at the solution in IE, open up the developer tools by pressing F12. Using those tools will get you where you want to be.

P.S. Developer tools in IE also allow you to do javascript debugging right there in the browser.

evasilchenko
  • 1,862
  • 1
  • 13
  • 26
  • Thanks for your response DeviantSeev :). Regarding your statement "You should focus on the events which are fired after the row is selected. You can do this by looking at the javascript which was written to interact with the gridview". To focus on those events I need to find those events :). Which is why I need to do what I mentioned above. – developer747 Mar 08 '12 at 16:38
  • You can find those events by just examining the backing javascript of the gridview. There is no need to put a break-point in every event. I would start at the beginning and just go through each line of code to see if it's something that I'm looking for. – evasilchenko Mar 08 '12 at 16:53
  • The backing javascipt is a 500 kb file. The gridview itself doesnot hold information to the js events fired. Somewhere in the 500 kb file , some code has subscribed to some event on the gridview (either by looking at the html class or id). – developer747 Mar 08 '12 at 16:57
  • I would start by just doing a text find on the name, class or id of the dom element that is the gridview. I.E. My grid view is
    So I would look for "gridView" within the javascript file.
    – evasilchenko Mar 08 '12 at 17:03
  • Ive already tried that and realized that it would be a time consuming process. Hence if there is an easy way to add break points on every method, that would save me time. Using brute force like you mentioned above is always an option. – developer747 Mar 08 '12 at 17:08
  • Just so you know, I appreciate you putting in effort to answer all my questions :) – developer747 Mar 08 '12 at 17:09
  • It's no problem. It's what we're here for. Let me know if you need any other clarification on this topic through the comments. Thank you for marking it as the answer, too. – evasilchenko Mar 08 '12 at 19:54