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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

include files

Status
Not open for further replies.

Sarky78

Programmer
Oct 19, 2000
878
GB
hi

I have a reference in a database to a file, i am trying to include this file within a page, using:
<!--#include file =&quot;<%=dboutput%>&quot;-->

when i run this page nothing happens, when i view the source it has actually processed the dboutput field but has not actually included it into the page. can anyone see what i am doing wrong, or offer any assistance ?

cheers

tony
 
U cannot include a file in a variable cuz the asp interpreter include the file first and then process the instructions... u have to use whole name of the file.
It wouldn't generate an error if u use this...

<!-- This script will fail -->
<% name=(header1 & &quot;.inc&quot;) %>
<!-- #include file=&quot;<%= name %>&quot; -->

<!-- This script will fail -->
<%
For i = 1 To n
statements in main file
<!-- #include file=&quot;header1.inc&quot; -->
Next
%>

Occasionally, it may be desirable to include a server-side file by using the HTML <SCRIPT></SCRIPT> tags. For example, the following script includes a file (by means of a relative path) that can be executed by the server:

<SCRIPT LANGUAGE=&quot;VBScript&quot; RUNAT=SERVER SRC=&quot;Utils\datasrt.inc&quot;></SCRIPT>

This is an example of use of the virtual key
It's worked with the include file to...
#include virtual filename=&quot;...&quot;

Relative SRC=&quot;Utilities\Test.asp&quot;
Virtual SRC=&quot;/MyScripts/Digital.asp&quot;
Virtual SRC=&quot;\RegApps\Process.asp&quot;
________

George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top