Dynamically including files. 
Author Message
 Dynamically including files.

I have an asp page that I want to dynamically include files by using the
<--#include file"bla.htm"--> command, except that the page name would be
requested dynamically based on my asp code.  What I tried to do was create a
variable and assign this string to it:

mainframe = "<!--#include file=" & Chr(34) & page & ".inc" & Chr(34) & "-->"

and then do something like this inside my HTML to include the file:
<%=mainframe%> and I figured that'd work.  Well it doesn't work so does
anyone have any solutions as to how I could do this?

Thanks



Mon, 15 Jul 2002 03:00:00 GMT  
 Dynamically including files.

Won't work (or more correctly, can't work...).  The includes are resolved before any script code is executed.

--
Michael Harris


  I have an asp page that I want to dynamically include files by using the
  <--#include file"bla.htm"--> command, except that the page name would be
  requested dynamically based on my asp code.  What I tried to do was create a
  variable and assign this string to it:

  mainframe = "<!--#include file=" & Chr(34) & page & ".inc" & Chr(34) & "-->"

  and then do something like this inside my HTML to include the file:
  <%=mainframe%> and I figured that'd work.  Well it doesn't work so does
  anyone have any solutions as to how I could do this?

  Thanks



Mon, 15 Jul 2002 03:00:00 GMT  
 Dynamically including files.

Actually they all get included and only conditionally processed and returned to the browser...  It's no different than if you had manually coded the contents of the included files directly at the same points in the asp file to start with.

--
Michael Harris


  You can include files through during the excecution of a code, for example:

  <%
  if temp = "whatever" then %>
  <!--include.........>
  <%else%>
  <!--include..........>
  <%end if%>

  This is the only way it can be done.

  Regards,
  Fabian

    Won't work (or more correctly, can't work...).  The includes are resolved before any script code is executed.

    --
    Michael Harris


      I have an asp page that I want to dynamically include files by using the
      <--#include file"bla.htm"--> command, except that the page name would be
      requested dynamically based on my asp code.  What I tried to do was create a
      variable and assign this string to it:

      mainframe = "<!--#include file=" & Chr(34) & page & ".inc" & Chr(34) & "-->"

      and then do something like this inside my HTML to include the file:
      <%=mainframe%> and I figured that'd work.  Well it doesn't work so does
      anyone have any solutions as to how I could do this?

      Thanks



Tue, 16 Jul 2002 03:00:00 GMT  
 Dynamically including files.

You can include files through during the excecution of a code, for example:

<%
if temp = "whatever" then %>
<!--include.........>
<%else%>
<!--include..........>
<%end if%>

This is the only way it can be done.

Regards,
Fabian

  Won't work (or more correctly, can't work...).  The includes are resolved before any script code is executed.

  --
  Michael Harris


    I have an asp page that I want to dynamically include files by using the
    <--#include file"bla.htm"--> command, except that the page name would be
    requested dynamically based on my asp code.  What I tried to do was create a
    variable and assign this string to it:

    mainframe = "<!--#include file=" & Chr(34) & page & ".inc" & Chr(34) & "-->"

    and then do something like this inside my HTML to include the file:
    <%=mainframe%> and I figured that'd work.  Well it doesn't work so does
    anyone have any solutions as to how I could do this?

    Thanks



Wed, 17 Jul 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Include JavaScript file in another include file

2. Dynamically Include HTML

3. Dynamically Include HTML

4. how to pass parameters in an include file which is included in an asp page

5. Include files in the *.EXE file.

6. How to extract a file including folder using setup.lst from xxx.cab file

7. Number of files included in a CAB file

8. dynamically getting file name when saving DOC file in VB

9. How to include files in .exe file

10. including file info in file list box

11. Crystal Reports: add/delete groups dynamically and starting a new page dynamically

12. Including another postscript file in a postscript file

 

 
Powered by phpBB® Forum Software