Debugging JavaScript in Visual Studio
2007-05-26 21:31 Valens 阅读(366) 评论(0) 编辑 收藏 举报From : http://aspalliance.com/1096_Debugging_JavaScript_in_Visual_Studio
Step 1:
Open an existing asp.net application in Visual Studio 2003/05 if there is any, which uses JavaScript or create a new demo application from scratch.
Step 2:
When we create a web project in Microsoft’s Visual Studio a file in the name of web.config is created by default in the web project.
We need to check the following setting:
Then change the debug setting to “true” as in the following.
Step 3:
Open Internet Information Service (IIS). Here is how to open IIS.
Start -> Settings -> Control Panel -> Administrative Tools -> Internet Information Services -> Expand Web Sites -> Default Web Site -> right click on your web project you want to debug and click properties -> click Directory Tab -> click configuration -> in the new opened window click Tab Debugging and if two check boxes labeled “Enable Server Side Script Debugging” and “Enable Client Side Script Debugging” are unchecked then check those two check boxes. (Pl refer to Screen Shot 1)
Figure 1
Step 4:
Open the Internet Explorer browser, click on menu Tools -> Internet Options -> Advanced Tab -> if Disable Script Debugging (Internet Explorer) and Disable Script Debugging (Other) check boxes are checked then uncheck those two check boxes and click button OK. (Refer Screen Shot 2)
Figure 2
Step 5:
Now, open your web project in Visual Studio IDE. Select menu Tools.
If you open the project in VS 2003 then under Tools menu select attach a process and select aspnet process and attach the process to the application.
If you open the project in VS 2005 then it does not require you to explicitly attach the aspnet process. In the JavaScript add a break point where you want to debug and also add a break point in the .vb or .cs code file where the JavaScript function is called.
Step 6:
Run the project by clicking on icon Start. The application will start and wait at the break point where you placed the break point.