ASP

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentASP

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old December 17th, 2005, 09:05 PM
herong herong is offline
Contributing User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Posts: 3 herong New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: < 1 sec
Reputation Power: 0
Debugging ASP Pages with Microsoft Script Debugger

For other ASP tutorials by Herong, see URL
------------

Running MS Script Debugger

MS Script Debugger can be used to debug both client side and server side scripts. Here is how to set up your system to debug server side VBScript pages.

1. Turning on debugging support on the IIS server. Run Internet Services Manager, and right mouse click on Default Web Site to select Properties. On the properties dialog box, click the Home Directory tab, and click the Configuration button. Then on the configuration dialog box, click the App Debugging tab. Then click the check box for "Enable ASP server-side script debugging".

2. Running MS Script Debugger. On Windows 2000 systems, you should go to the Start button, then select Programs, then select Accessories, you will see MS Script Debugger is installed there. So run it from there.

3. Loading the ASP page to IIS. Use IE to request the ASP you want to debug. This will trigger the ASP page to be loaded into IIS.

4. Loading your ASP page into the debugger. On MS Script Debugger, select Running Documents from the View menu, you will see the Running Documents window showing up with a tree view of running IE browsers and IIS server. Follow the tree view to locate the IIS server, then Default Web Site, then the ASP page you want to debug. Double click on the ASP page to load the ASP page source code into the debugger.

5. Setting a breakpoint in the ASP source code. With the ASP source code loaded in the bugger, you can set up break points by locating the statements and click the breakpoint icon.

6. Running the ASP page to the breakpoint. Use IE to request your ASP page again. Now IIS will stop processing the ASP page at your breakpoint for debugging.

Debugging ASP Pages

Now we know how to set up the ASP page to run in the debugger. Let's play the debugger with the following ASP page.
[code]
<%@ language="vbscript"%>
<!-- debug_test.asp
Copyright (c) 2002 by Dr. Herong Yang
This program has a create and open files as text stream
objects.
-->
<html><body>
<%
response.write("Calculating term deposit income:
")
capital = 100
interest = 8.0
term = 10
value = capital
for i = 1 to term
value = value * (1+interest/100)
next
response.write("Capital = " & capital & "
")
response.write("Interest = " & interest & "
")
response.write("# of terms = " & term & "
")
response.write("Value = " & value & "
")
%>
</body></html>[code]

Now load the ASP page to IIS and the debugger. If you put a breakpoint at the beginning of the "for" statement and request the page, IIS will execute the page and stop at the breakpoint. Here is what we can do with the debugger.

1. If you click the step over icon, IIS will execute the current statement and stop at the next statement.

2. If you want to see the value of variable "interest", you need to select Command Window from View menu. In the command window, type "? interest", you will see the value of "interest", 8, displayed.

3. Actually "?" command in the command window can be used to evaluate any expression. Try this: "? interest/100", you will get 0.08.

4. Further more, you can execute any VBScript statements in the command window. For example, "interest = 7.5" will change the value in "interest" to 7.5.

------------
For other ASP tutorials by Herong, see URL

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentASP > Debugging ASP Pages with Microsoft Script Debugger


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap