showing ASPAlliance 468 banner
 CoverYourASP --> Hidden debug data!

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
267 active users
3768 visitors today
2152 pages today
how is this done?
Tools I use

CoverYourASP
Copyright © 1999-2013 James Shaw.
All rights reserved.

ASP.NET Blog
RSS submissions
E-commerce

Now open source with SourceForge!

[You typed in this URL directly]

This page is alive with extra information that can help you debug your pages. Can you see it?

[of course you can see it - I know you're in debug mode otherwise this would be invisible too!]

Recently I had to debug a complex ASP page. The page asked the user for some information which it used to look up a lot of interelated data in a database. Then it called a COM component which calculated an answer. The rules were quite complex to say the least!

[yeh, yeh, ever so complex - ooooh!]

What I needed was a way to optionally display some information on the page so that the beta testers could help me pinpoint what had gone wrong during testing.

The answer is simple - test for a certain circumstance, and optionally do some Response.Write's with the data.

[obvious, huh?]

I do this on my development machine by testing if I'm running on a server called localhost, like this:
var sServer = "" + Request.ServerVariables ( "SERVER_NAME" );

bDebug = ( -1 != sServer.indexOf ( "localhost" ) );

The variable "bDebug" is then available for use wherever you need. For demonstration purposes this site uses a simpler strategy - you can simply add "?debug" to the URL's QueryString to see debug info!

Want to see it again without debug info - go to Debug.asp.

[Your IP address is 204.236.235.245]

[Server software is "Microsoft-IIS/7.5"]

[This script is called "/Debug.html"]

[The physical path is "C:\HostingSpaces\jshaw\coveryourasp.com\wwwroot\"]

[This script was requested by "GET"]

Featured sponsor
showing ASPAlliance square
My favorite resources
showing ASPAlliance textad

showing ASPAlliance textad

showing ASPAlliance square


I share my content

Supporting ASPRSS

Do you need a quick and easy way to link to my articles? All the information you need is published with ASPRSS...

CoverYourASP Mugs, T-shirts, caps - even Boxer shorts...
I don't make a penny from these, but they're a lot of fun! Don't you need a new mouse mat?

showing ASPAlliance square

[I had to generate 0 wasted numbers!]

[This server is called "www.coveryourasp.com"]