![]() |
Table of Contents |
![]() |
Testing ASP ScriptsTesting ASP scripts can be a bit of a pain. Typically, an error results in a browser window like the one shown in Figure 21.1. Figure 21.1. ASP errors display in the browser windowThe technical information in the error message breaks down as follows: HTTP 500.100 - Internal Server Error - ASP error Internet Information Services Technical Information (for support personnel) Error Type: Microsoft VBScript compilation (0x800A03EE) Expected ')' /display.asp, line 10, column 31 Request("COMPUTERNAME" & "<HR>" The important information is under "Error Type," and in this case, the error is that VBScript was expecting to see a closing parentheses and it didn't. The offending line of code is helpfully displayed. It looks like I forgot to include a ")" after Request("COMPUTERNAME", and that's causing the error. It's helpful to have an editor like FrontPage or PrimalScript that displays line and column numbers. You can jump straight to the line in question, but beware of the column number: In this example, ASP is giving me column 31, which is actually at the end of the line, but the error is at column 23. ASP isn't always good about pinpointing errors. When you encounter an error like this one, simply edit your script, save it, and click Reload in the Web browser. The browser should resubmit the page request, and you can try again. That's pretty much how ASP testing and debugging goes: Try it, see an error, fix it, and try again. It's not unlike regular scripting, in fact. However, you don't get the advantage of a debugger with the native Windows tools (Notepad), and PrimalScript (and most third-party editors) cannot attach to ASP for debugging. Serious ASP debugging is available only in Microsoft Visual InterDev 6.0 and in Microsoft Visual Studio .NET, tools normally reserved for hardcore software developers. |
![]() |
Table of Contents |
![]() |