Microsoft KB Archive/255886

From BetaArchive Wiki
Knowledge Base


INFO: How to Pause ASP Code for Debugging

Article ID: 255886

Article Last Modified on 7/14/2004



APPLIES TO

  • Microsoft Active Server Pages 4.0
  • Microsoft Internet Information Server 4.0
  • Microsoft Internet Information Services 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.

Keywords: kbinfo kbbug kbcodesnippet kbdebug KB255886