Link to home
Start Free TrialLog in
Avatar of simon_aurell
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?
Avatar of simon_aurell
simon_aurell

ASKER

Edited text of question.
Edited text of question.
The file you place it in needs to be called *.ASP

this is a vbscript tag
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/noise.icon0a.htmlf"-->
                           <!--#include virtual="/netizen/97/06/question.icon0a.htmlf"-->
                           <!--#include virtual="/netizen/97/06/quote.icon0a.htmlf"-->
                           </td>
Avatar of knightEknight
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
%>

however, I don't know what "virtual" means in this context, try this:

<!--#include file="whatever.html"-->

that i do know, virtual makes the path like this :

www.whatever.com/whatever.html
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>
(and yes, the file exists)

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"-->
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?
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.
oh.. hehe
guess i must give someone credits for this, so i'll consider that last comment an answer.
ASKER CERTIFIED SOLUTION
Avatar of knightEknight
knightEknight
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial