simon_aurell
asked on
includes
for some reason i can't get a simple text include to work..
shouldn't this:
<!--#include virtual="whatever.html"-->
include the text in that file?
or is some server configuration needed, like defining filetypes used as includes?
shouldn't this:
<!--#include virtual="whatever.html"-->
include the text in that file?
or is some server configuration needed, like defining filetypes used as includes?
ASKER
Edited text of question.
The file you place it in needs to be called *.ASP
this is a vbscript tag
this is a vbscript tag
ASKER
no, i'm pretty sure it isn't.. this is just a basic ssi-tag..
here's what webmonkey says:
For example, HotWired's The Netizen uses virtual includes to
pull in side GIFs for navigation between the columns and Noise,
Daily Poll, and Daily Quote. The virtual includes are embedded
in a table cell like this:
<td align=center valign=top width=80>
<!--#include virtual="/netizen/97/06/no ise.icon0a .htmlf"-->
<!--#include virtual="/netizen/97/06/qu estion.ico n0a.htmlf" -->
<!--#include virtual="/netizen/97/06/qu ote.icon0a .htmlf"-->
</td>
here's what webmonkey says:
For example, HotWired's The Netizen uses virtual includes to
pull in side GIFs for navigation between the columns and Noise,
Daily Poll, and Daily Quote. The virtual includes are embedded
in a table cell like this:
<td align=center valign=top width=80>
<!--#include virtual="/netizen/97/06/no
<!--#include virtual="/netizen/97/06/qu
<!--#include virtual="/netizen/97/06/qu
</td>
Actually, the syntax is correct -- it doesn't have to include an ASP file (it's not a vbscript tag, it's an NT server include statement). However, it does have to be outside the ASP delimiters (if it is in an ASP file)
This won't work:
<%
'other vb code
<!--#include virtual="whatever.html"-->
'other vb code
%>
but this will:
<%
'other vb code
%>
<!--#include virtual="whatever.html"-->
<%
'other vb code
%>
This won't work:
<%
'other vb code
<!--#include virtual="whatever.html"-->
'other vb code
%>
but this will:
<%
'other vb code
%>
<!--#include virtual="whatever.html"-->
<%
'other vb code
%>
however, I don't know what "virtual" means in this context, try this:
<!--#include file="whatever.html"-->
<!--#include file="whatever.html"-->
ASKER
that is exactly what's bothering me - this SHOULD work!
it isn't in an asp-file!
this is the entire file - why doesn't it work?
<html>
<head>
<title>whatever</title>
</head>
<body>
<!--#include virtual="include.html"-->
</body>
</html>
it isn't in an asp-file!
this is the entire file - why doesn't it work?
<html>
<head>
<title>whatever</title>
</head>
<body>
<!--#include virtual="include.html"-->
</body>
</html>
ASKER
(and yes, the file exists)
the only thing i can think of is that ssi must be enabled on the server or something
the only thing i can think of is that ssi must be enabled on the server or something
Is include.html in the virtual root of this site?
Is there a reason why a regular include won't work for you?:
<!--#include file="whatever.html"-->
Is there a reason why a regular include won't work for you?:
<!--#include file="whatever.html"-->
ASKER
i've tried "include file" too, with the same result: nothing happens
the file i want to include lies in the same directory.. is this a problem?
the file i want to include lies in the same directory.. is this a problem?
ASKER
can't this be done locally?
Ah, yes, this is a function of the server, so it won't show up if you open it like this:
c:\temp\myfile.htm
Put the file (and the include) on an IIS server, and that will work.
c:\temp\myfile.htm
Put the file (and the include) on an IIS server, and that will work.
ASKER
oh.. hehe
guess i must give someone credits for this, so i'll consider that last comment an answer.
guess i must give someone credits for this, so i'll consider that last comment an answer.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER