INFO: How to Pause ASP Code for Debugging (255886)



The information in this article applies to:

  • Microsoft Active Server Pages
  • Microsoft Internet Information Server 4.0
  • Microsoft Internet Information Server 5.0

This article was previously published under Q255886

SUMMARY

This article describes how to debug Active Server Pages (ASP) code written in Microsoft JScript or Microsoft Visual Basic Scripting Edition.

MORE INFORMATION

Before debugging server-side code, you need to enable debugging for your site. From the Microsoft Management Console (MMC), right-click the virtual directory, select Properties, and click Configuration. On the App Debugging tab, select Enable ASP server-side debugging.

To debug in JScript, place the DEBUGGER statement before the line of code at which you want to pause; for example:
<%@ Language=JScript%>
<%
	Response.Write("Hello");
	debugger
	Response.Write("World");
%>
				
To debug a script written in VBScript, place the STOP statement before the line of code at which you want to pause; for example:
<%
	Response.Write "Hello"
	Stop
	Response.write "World"
%>
				
When this script is run from a browser, the debugger interrupts the script and displays the .asp file with the statement pointer indicating the location of the DEBUGGER or STOP statement. At this point, you can inspect the values assigned to variables before they are passed to the component.

NOTE: Remember to disable debugging in production servers.

Modification Type:MinorLast Reviewed:7/14/2004
Keywords:kbBug kbCodeSnippet kbDebug kbinfo KB255886