• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

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?
0
simon_aurell
Asked:
simon_aurell
  • 8
  • 5
  • 2
1 Solution
 
simon_aurellAuthor Commented:
Edited text of question.
0
 
simon_aurellAuthor Commented:
Edited text of question.
0
 
siabodCommented:
The file you place it in needs to be called *.ASP

this is a vbscript tag
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
simon_aurellAuthor Commented:
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>
0
 
knightEknightCommented:
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
%>

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

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

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

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

the only thing i can think of is that ssi must be enabled on the server or something
0
 
knightEknightCommented:
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"-->
0
 
simon_aurellAuthor Commented:
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?
0
 
simon_aurellAuthor Commented:
can't this be done locally?
0
 
knightEknightCommented:
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.
0
 
simon_aurellAuthor Commented:
oh.. hehe
guess i must give someone credits for this, so i'll consider that last comment an answer.
0
 
knightEknightCommented:
Glad we could help.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 8
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now