This article describes how to debug Active Server Pages (ASP) code written in Microsoft JScript or Microsoft Visual Basic Scripting Edition.
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.