?
Solved

includes

Posted on 1999-07-19
15
Medium Priority
?
256 Views
Last Modified: 2013-11-18
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
Comment
Question by:simon_aurell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
  • 2
15 Comments
 

Author Comment

by:simon_aurell
ID: 1852108
Edited text of question.
0
 

Author Comment

by:simon_aurell
ID: 1852109
Edited text of question.
0
 
LVL 4

Expert Comment

by:siabod
ID: 1852110
The file you place it in needs to be called *.ASP

this is a vbscript tag
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:simon_aurell
ID: 1852111
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
 
LVL 33

Expert Comment

by:knightEknight
ID: 1852112
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
 
LVL 33

Expert Comment

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

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

0
 
LVL 4

Expert Comment

by:siabod
ID: 1852114
that i do know, virtual makes the path like this :

www.whatever.com/whatever.html
0
 

Author Comment

by:simon_aurell
ID: 1852115
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
 

Author Comment

by:simon_aurell
ID: 1852116
(and yes, the file exists)

the only thing i can think of is that ssi must be enabled on the server or something
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 1852117
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
 

Author Comment

by:simon_aurell
ID: 1852118
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
 

Author Comment

by:simon_aurell
ID: 1852119
can't this be done locally?
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 1852120
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
 

Author Comment

by:simon_aurell
ID: 1852121
oh.. hehe
guess i must give someone credits for this, so i'll consider that last comment an answer.
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 150 total points
ID: 1852122
Glad we could help.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Find out what you should include to make the best professional email signature for your organization.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question