Donate

How To Debug JavaScript Code In Visual Studio 2008 Or Visual Studio 2010

Here are the simple steps to debug js code in your aspx markup.

1. Open Visual Studio 2008/2010
2. Click Tools then options
3. Expand debugging node then click checkboxes Manages,Native,Script.
4. In your web.config file,make sure to set compilation debug to true.
  <compilation debug="true">       
       <assemblies>  
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral,   
           PublicKeyToken=B77A5C561934E089"/>  
        <add assembly="System.Web.Extensions, Version=3.5.0.0,   
           Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0,   
           Culture=neutral, PublicKeyToken=B77A5C561934E089"/>  
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral,   
           PublicKeyToken=B77A5C561934E089"/>  
       </assemblies>  
      </compilation> 
5. Choose IE as default browser by right clicking on the .aspx webpage then choose IE as default browser.
6. Place a breakpoint in your js script, then run your code.
 <script type="text/javascript" language="javascript">  
     function myHello()   
     {  
       var x = 5;  
       var y = 6; //place breakpoint here or anywhere in your code  
       alert((x + y));    
     }  
   </script> 

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Insert Or Add Emojis In Microsoft Teams Status Message

Pass GUID As Parameter To Action Using ASP.NET MVC ContribGrid