So the good news is that we have the "debugger" keyword to debug your line of code.
Use debugger before your code, where you want to start debugging.
See the following code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.7.1.min.js"></script>
<script>
$(document).ready(function () {
$(':radio').click(function () {
debugger;
//Get the value of Radio button
var _GetVal = $(this).attr('value');
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
First
<input type="radio" name="rd1" value="10" />
<input type="radio" name="rd1" value="11" />
Second
<input type="radio" name="rd1" value="12" />
<input type="radio" name="rd1" value="13" />
</div>
</form>
</body>
</html>
This is a simple ASP.NET in page code. When the user clicks a radio button, debugging will automatically start, due to the debugger command. In the above program, when the user clicks on the radio button we stored its value in the _Getval variable.
$(document).ready(function () {
$(':radio').click(function () {
debugger;
//Get the value of Radio button
var _GetVal = $(this).attr('value');
});
});
You can see that when I declare a _GetVal variable, before I use "debugger" because from here I want to start debugging. See the following images.
Figure 1: When user clicks in the radio
Figure 2: When the user presses F10 (the same way as what we did in code behind using a breakpoint).
In the image above you can see that the _GetVal value is 10 now. So with the use of the debugger you can start your debugging in ASP.NET.
And please remember, when you finish debugging or publish your page, please remove debugger from your code.
If you have any query, Please send your valuable Comments. Happy Programming.


Manav PandyaPosted Jun 15, 2017, 3:24 AM EDT
But debugger is not working as you have mentioned
Manav PandyaPosted Jun 15, 2017, 2:43 AM EDT
Nice share brother ..............
Devang JaniPosted Nov 4, 2016, 1:47 AM EDT
When i debug with debugger, it will also debug to js file that i dont want and it not debugging to my API
Amit Kumar SinghPosted Mar 9, 2016, 12:01 AM EST
Nice Share
shajiya begamPosted Mar 8, 2016, 11:23 PM EST
nice post.. useful for me.@Sourab Mishra
Anurag SarkarPosted Jun 3, 2013, 11:52 AM EDT
nice.
Ravikumar GPosted May 6, 2013, 8:36 PM EDT
nice...
Mahesh KumarPosted May 6, 2013, 9:39 AM EDT
Sourabh, this command works in internet explorer browser only. Debugging in other browsers add-on are needed like firebug for mozilla. BTW good article for very beginners
Jack OwenseditedPosted May 1, 2013, 2:27 PM EDTEdited May 1, 2013, 2:29 PM EDT
1. If the user forgets to comment/remove the word "debugger" and publishes how does the deployed application behave?2. Is there any easy way (Global Setting) to say disable "debugger" code within "jQuery" code section such that everywhere developer has added "debugger" code is all commented or ignored by complier?
Sourabh MishraPosted Apr 25, 2013, 8:26 AM EDT
Dear Mahesh Sir and Anil Sir, thanx for your valuable comments.
Anil KumarPosted Apr 24, 2013, 10:55 PM EDT
Saurabh, plz don't feel hurt. You explained how to use 'debugger' very nicely.
Anil KumarPosted Apr 24, 2013, 10:52 PM EDT
1) debugger is not a jQuery command. 2)It is used to suspend the execution in Javascript and very similar to setting breakpoint 3)'So the good news is that we have a command in jQuery, it is "debugger"' this line should be corrected. 4) Mahesh sir: It is not new feature. 5) Admin panel: it was a good blog instead
Mahesh ChandTOP 10Posted Apr 24, 2013, 7:18 PM EDT
Nice Saurabh. I think this feature is added in Visual Studio 2012?