Problem With Include File

haoli12345
04-15-2002, 05:44 PM
I want to include a different file everytime and I saved the filename into a variable called PAGFILE. This is what im trying to accomplish:

<%
Dim PAGFILE
PAGFILE = "/hvwebdesign/pag/default.asp"
%>

<!-- #INCLUDE VIRTUAL=[asp variable PAGFILE goes here] -->

I've tried this but it doesn't work can anyone help??

<% RESPONSE.WRITE "<!-- #INCLUDE VIRTUAL=" & PAGFILE & " -->" %>


-Hao Li-

joan_fl
04-15-2002, 06:28 PM
Unfortunetly you can not do this. See asp pages are compiled and run EVERYtime they are "hit". Include file are processed (included) before they are compiled, and run. Your tring to use a varible BEFORE its been compiled, run or even initialized.

Hope this helps!

Joan

haoli12345
04-15-2002, 06:38 PM
Is there a another way of adding an another page into the main layout page? See here is my problem I have a layout page called default.asp it has menus, tables, titles etc. and I also have pages in the "pag" directory what I want to do is to add the pages in the pag directory into default.asp so everytime I update my layout I only have to update the layout for default.asp and not the rest. If I want to go to another page I use something like this default.asp?page=home.asp. Any ideas.


-Hao Li-

joan_fl
04-15-2002, 06:46 PM
Heres what i do. Im not sure if it helps your problem.

I have 4 main include files, on all my pages...

top.asp
left.asp
[Content Goes here]
right.asp
bottom.asp

Anytime I change the layout, graphics (top.asp, left.asp, right.asp, bottom.asp).. all the pages that use the above template get all the updates to.

Does this help?

Joan

Rezner
04-20-2002, 06:25 PM
Building on what Joan said. default.asp could look something like what is below and contain five individual .inc files -- each with its own *ML code in it


<TABLE BORDER=1>
<TR>
<TD COLSPAN=4><!-- #include file=includes\header.inc --></TD>
</TR>
<TR>
<TD><!-- #include file=includes\left_content.inc --></TD>
<TD COLSPAN=2><!-- #include file=includes\mid_content.inc --></TD>
<TD><!-- #include file=includes\right_content.inc --></TD>
</TR>
<TR>
<TD COLSPAN=4><!-- #include file=includes\footer.inc --></TD>
</TR>
</TABLE>

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum