Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / .NET

Debugging client JavaScript in Visual Studio 2005/.NET?

3.40/5 (4 votes)
19 Dec 2010CPOL 19.8K  
Debugging client JavaScript in Visual Studio 2005/.NET?
Step 1: 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


Step 2: In your JavaScript function, add the keyword debugger. This causes VS.NET to switch to debug mode when it runs that line.
Note: If we put the break point only does not work sometimes, so use debugger keyword in the JavaScript code.

<script language="javascript">
       function Add(){
           debbuger; //keyword used to debug the javascript
           var a;
           a=10+20;
           alert(a);
         }

</script>


Step 3: Run your ASP.NET application in debug mode.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)