As everyone knows, Active Server Pages doesn't have the best debugging
capabilities out of the box, but there are several techniques you can
implement yourself that will help you with debugging down the line.
One we've found that works well is to use a simple session variable to
keep track of whether you're in "debug mode" or not. Add the following
code to the first page of your application:
if request("debug") <> "" then
session("debug") = "true"
end if
Then, in subsequent pages of your application, you can interrogate the
value of this session variable to determine whether you should execute
all those response.write's and similar debugging code, like this:
if session("debug") = "true" then
response.write "Variable strUser is " & strUser
response.write "Variable intLoop is " & intLoop
response.write "The SQL we're executing is " & strSQL
'And so on
else
'Just do it!
end if
When it's time to run your application in debug mode, simply invoke the
page with the QueryString "?debug=something" in your URL, like this:
http://localhost/mycoolapp.asp?debug=on
When this QueryString value is left out, the application will run in
production mode, that is, without executing all your debug code.
Plan for debugging
By ElementK Journals, published on 14 Jul 2001
| Filed in
You might also like...
ASP (3.0) forum discussion
-
Invitation to take part in an academic research study
by researchlab (0 replies)
-
How to insert & edit unique value using store procedure
by umeshdaiya (0 replies)
-
How to troubleshoot Epson laser printer?
by daisywyatt618 (0 replies)
-
view state is stored after the page post-back
by shriniwas.khatri852 (0 replies)
-
Transfer selected rows from one GridView to another GridView in aspxform(ASP.NET)
by dorsa (0 replies)
ASP (3.0) podcasts
-
Hanselminutes: Startup Series: Buying an Existing Small Company or Online Application
Published 8 years ago, running time 0h34m
Scott talks to Rob Walling about how he purchases small niche products and companies online and revitalizes them. He recently purchased an existing product that consisted of a 300 gig database and tens of thousands of lines of Classic ASP. How did he know it was valuable? What's next?
Comments