Debugging JavaScript Codes in VisualStudio.Net

Debugging java-script is like a breeze in VS.Net, Really it helped me a lot in my recent ASP.NET AJAX web app where we extensively used Infragistics ASP.NET UI components es-specially their flagship component ULTRAWEBGRID which exposes wonderful javascript API [CSOM- Client Script Object Model]

Follow these steps to enable script debugging in VS.NET

Tools->Internet Options…->Advanced->Disable Script Debugging [Un-check]

1.gif

2.gif

4.gif

When you’ve enabled Script Debugging, then in the IE go to,  View->Script Debugger->Open

5.gif

Once you clicked Open, the page reloads and activates the script debugger, you can set break-point and do F10 & F11.

Alternately, you can put a line like this in the java-script code where you need to break

debugger;

Example;

function Debug()
{    
	debugger;
	alert('Break at above statement');  
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s