Forums

ASP

This topic is locked

Include files

Posted 29 Jul 2002 18:02:05
1
has voted
29 Jul 2002 18:02:05 Tony Chronopoulos posted:
Hello everyone..


I'm trying to use Include files so I can reduce future work load! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> I decided to extract the menu and put it in a file called menu.asp. Then, where the menu used to be on each page, I entered:

<pre id=code><font face=courier size=2 id=code>
&lt;!--#INCLUDE FILE="menu.asp"--&gt;
</font id=code></pre id=code>

I removed all the functions to do with the menu and placed them in an external JS file (functions that UD generates when you import a fireworks document). In my .asp pages, in the &lt;body&gt;, there is still the onLoad event which preloads all the images - can I somehow stick this into the JS file so I don't have it in each page?


Last but not least, can there be code in the include file that refers to one of my recordsets? Personally, I don't think it's possible because I think include files always load first so then that means the recordset doesn't exist yet. (I get a darn error)


Thanks a lot for any help!!!

Tony

___________________
Lunch is on me! <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>

Replies

Replied 30 Jul 2002 09:38:27
30 Jul 2002 09:38:27 Viktor Farcic replied:
Includes are loaded first but that doesn't mean you can't make what you want. Create code in Include as function or subprocedure and refer to it later in the page.

I'm using this approach for including meta tags on my pages. Take a look at: www.farcic.com/resources/resources.asp?mnuID=12

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Last but not least, can there be code in the include file that refers to one of my recordsets? Personally, I don't think it's possible because I think include files always load first so then that means the recordset doesn't exist yet. (I get a darn error)
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Viktor Farcic
www.farcic.com
TalkZone Manager
Replied 30 Jul 2002 13:55:56
30 Jul 2002 13:55:56 Tony Chronopoulos replied:
I'm not sure how I can do that because the code that I'm refering to is a table that displays the logged in user's name and a login or logout button (if he's logged in then it shows logoff).

I'm not sure how I would put that in a function... hhummmmmmmmmmm.. hehe.. I'll think about it over breakfast!! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>


Thanks,
Tony

___________________
Lunch is on me! <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>

Reply to this topic