PDA

View Full Version : include file and images please help


ClueLess
09-14-2004, 05:12 PM
Can someone please give me advice or help me ...I don't know why the include file / image doesn’t work. What did I do wrong?

Here is my project:

In the wwwroot\myproject\ has the include folder, images folder, and index.asp.

I create an header.htm page and save it in the include folder. Because, I want to use the header.htm page in other places.

The images folder contains all the images in there.


Here is my header.htm page:

<table>
<tr>
<td>
<img src=”images/header.jpg”>
</td>
</tr>
</table>
==

Index.asp page - the include works..the header image shows.

<body>
<!--#Include File="include/header.htm"-->
</body>


here is a problem, I created a Math folder in the myproject. In the math folder I have a calculas.asp page.

In the calculas.asp, I've included the header.htm page

Here is what I did in the calculas.asp page

<body>
<!--#Include file="../include/header.htm"-->
</body>

It seems like...it's a right path, But the header image does not show? Why? Thanks for your help.

Roy Sinclair
09-14-2004, 05:42 PM
The problem is you're using INCLUDE FILE instead of INCLUDE VIRTUAL. If you've got to go upstream in the directory then you must use VIRTUAL instead of FILE (otherwise everything's the same).

ClueLess
09-14-2004, 05:58 PM
Thanks for your reply. I did try VIRTUAL, but I got an error on the index.asp as well as the caculas.asp

Error Type:
Active Server Pages, ASP 0126 (0x80004005)
The include file 'includes/header.htm' was not found.
/myproject/index.asp, line 36

MsZola
09-14-2004, 06:05 PM
did you perchance try /images/header.htm ?

I get messed up on relative paths all the time myself. If all else fails, try putting the full link in there and see if that works. If it doesn't, maybe it's something else entirely.

ClueLess
09-14-2004, 06:09 PM
can you please tell me more..I am not sure your answer...

Roy Sinclair
09-14-2004, 06:14 PM
Try:

<body>
<!--#Include virtual="/include/header.htm"-->
</body>

ClueLess
09-14-2004, 06:17 PM
I tried that it gives the same error message
Error Type:
Active Server Pages, ASP 0126 (0x80004005)
The include file '/includes/header.htm' was not found.
/myproject/index.asp, line 36

ClueLess
09-14-2004, 07:25 PM
I think, I got it works...just add the whole path in - in the header.htm page

<img src=”http://localhost/myproject/images/header.jpg”>