Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie Question

Status
Not open for further replies.

newbie1983

Programmer
Sep 9, 2003
52
GB
Hi,

I am writing my first asp page and is not going well, i get a run-time error from the very first line when i view the page in the browser:

Line 1:
Error: 'thisPage' is undefined

the first section of my code is here if it may prove helpful:

<%@ Language=VBScript %>
<% ' VI 6.0 Scripting Object Model Enabled %>
<!--#include file="_ScriptLibrary/pm.asp"-->
<% if StartPageProcessing() Then Response.End() %>
<FORM name=thisForm METHOD=post>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<body TOPMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" BOTTOMMARGIN="0">

Any suggestions would be greatly appreciated.

Kind Regards

HP


 
For starters, all page content should be within the <BODY></BODY> tags of your page. this includes this line...
Code:
<FORM name=thisForm METHOD=post>

Move that line below your <BODY> tag and see if it helps. If not then you will need to post more code for us to see.


Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
this line
Code:
<!--#include file="_ScriptLibrary/pm.asp"-->

should be
Code:
<!--#include [blue][b]virtual[/b][/blue]="_ScriptLibrary/pm.asp"-->
because the included file is not in the same folder

and uncheck "Show friendly HTTP error messages" in IE
Tools -> Internet Options -> Advanced so you can see the full error message.



Chris.

Indifference will be the downfall of mankind, but who cares?
 
ChrisHirst
Why does it need to be virtual? I often have include files that are in an include/ directory and use the same method as shown above with no problems. Am I doing it wrong?


Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Thanks guys, got it sorted - all of your suggestions were great!

Kind Regards

HP
 
file= will be ok if the include folder is at the same level as the file calling it.
But if you use virtual= as a matter of course, it's one less thing to trip you up if you change the site structure around.

It maybe just personal preference of course. and it maybe it's the amount of hassle I've had converting things like forum code where the programmer didn't think about the end users structure and assumed it would be the same.




Chris.

Indifference will be the downfall of mankind, but who cares?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top