Alot of people in the forum ask simple questions about how to debug parts of their asp pages. And alot of those same questions can be answered with the same statement
Response.Write
Response.End
These two statements can be combined to be the best ASP debugger out there, and they are extremely easy to use.
If you have a page that you don't think is running, but a
Response.Write "Text"
Response.End
at the beginning. If the text you entered appears, then you know you are getting at least that far. (Remember before you get to sure that it doesn't run, sometimes it is helpful to bounce the browser to clear the session objects and the cache)
Have some if statements that are running right? Try this.
If Condition1 = True then
Response.write "Condition1"
Response.End
If Condition2= True then
Response.write "Condition2"
Response.end
Then run the code, and remove the response.writes as you see them. The first time you don't see a new Condition written to the page, then you know you aren't gettign into that IF, and you have found the variable causing the problem.
Best place to use Response.write is with DB connections. This can allow you to see the actual code that is being submitted to the database. This means you can copy and paste it to the DB and test it that way. You can see if maybe you missed a literal when you created the SQL statement.
Response.write
Response.end
are simply the easiest way to learn basic ASP debugging. The more you use them, the more you will learn about how ASP works, and how to debug it.
The money's gone, the brain is shot.....but the liquor we still got.
Response.Write
Response.End
These two statements can be combined to be the best ASP debugger out there, and they are extremely easy to use.
If you have a page that you don't think is running, but a
Response.Write "Text"
Response.End
at the beginning. If the text you entered appears, then you know you are getting at least that far. (Remember before you get to sure that it doesn't run, sometimes it is helpful to bounce the browser to clear the session objects and the cache)
Have some if statements that are running right? Try this.
If Condition1 = True then
Response.write "Condition1"
Response.End
If Condition2= True then
Response.write "Condition2"
Response.end
Then run the code, and remove the response.writes as you see them. The first time you don't see a new Condition written to the page, then you know you aren't gettign into that IF, and you have found the variable causing the problem.
Best place to use Response.write is with DB connections. This can allow you to see the actual code that is being submitted to the database. This means you can copy and paste it to the DB and test it that way. You can see if maybe you missed a literal when you created the SQL statement.
Response.write
Response.end
are simply the easiest way to learn basic ASP debugging. The more you use them, the more you will learn about how ASP works, and how to debug it.
The money's gone, the brain is shot.....but the liquor we still got.