Server Script Debugging

Understanding how scripts in .asp files are processed and how errors are handled can help you debug server scripts successfully. To debug server scripts ù scripts in .asp files ù you run Microsoft Script Debugger on the same computer that is running Microsoft Internet Information Server (IIS), version 4.0 or higher and attach it to a running document.

Note To debug .asp files, you must run Microsoft Script Debugger on the same computer that is running Microsoft Internet Information Server (IIS).

Processing Server Script

Script in an .asp file is not event-driven. Instead, when the page is requested, the server reads the page and processes all server script from top to bottom. This includes script that is inline with HTML text, as shown in the following diagram.

Because all script in the .asp file is processed as soon as the page is requested, both syntax errors and runtime errors are caught immediately.

A special case for server scripts is Global.asa files. The Application_OnStart and Session_OnStart procedures in these files are executed only once for an application and for a session. Therefore, you must embed debugging statements in the file to easily debug these events. For details, see Debugging a Global.asa File.

Using the Script Debugger With Server Script

To use Microsoft Script Debugger, you must be sure that it is enabled for that application. For details about enabling and disabling the debugger for ASP applications, see "Debugging ASP Scripts" in the IIS documentation.

If the debugger is enabled for the application:

If the debugger is not enabled for the ASP application:

See Also

Debugging Scripts

Client Script Debugging

Starting Microsoft Script Debugger


© 1997 by Microsoft Corporation. All rights reserved.