473,503 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with including a header

I have the following file structure:

/
header.asp
test.asp
/subDir
testpage.asp
/images

I would like to have header.asp to be usable from all directories.
Header.asp will have images and URLs. When I try to #include the file in
test.asp, it works fine. However, if I #include it in testpage.asp, the
images in header do not work - testpage.asp thinks the images are in subDir,
when they are in the images directory. I have tried a variety of
combinations of MapPath, Server.Execute, but I have not gotten the image to
appear correctly. What is the correct syntax for what I am trying to
accomplish?

Thank you for you time,
Jim
Jul 19 '05 #1
1 2751
Do virtual includes and image paths from the root in header.asp. Example:
Do NOT do:

<!-- #include file="../header.asp" -->
<img src="images/something.gif"> (in header.asp)

DO:

<!-- #include virtual="/header.asp" -->
<img src="/images/something.gif"> (in header.asp)

That way it will not matter if you're in a different directory level, since
it will all be relative from the root of your site, the include as well as
the image paths in the include file.

Ray at work

"Jim Mesara" <so******@yahoo.com> wrote in message
news:bi************@ID-147295.news.uni-berlin.de...
I have the following file structure:

/
header.asp
test.asp
/subDir
testpage.asp
/images

I would like to have header.asp to be usable from all directories.
Header.asp will have images and URLs. When I try to #include the file in
test.asp, it works fine. However, if I #include it in testpage.asp, the
images in header do not work - testpage.asp thinks the images are in subDir, when they are in the images directory. I have tried a variety of
combinations of MapPath, Server.Execute, but I have not gotten the image to appear correctly. What is the correct syntax for what I am trying to
accomplish?

Thank you for you time,
Jim

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2747
by: Tim Ward | last post by:
I'm trying to make an image which is a chart of some data. The graphics code on its own works fine - this is a file which in outline is: <?php Header ('Content-Type: image/png'); $img =...
26
1634
by: ashu | last post by:
lets look at the code given below here i m trying to do mudular programming /* this is my main prog.*/ /*mmod.c*/ #include<stdio.h> #include "mod1.h" int main(void) {
2
2283
by: Barrie | last post by:
I'm having a quite complicate situation, and it doesn't want to compile. The situation is as follows: I have three classes, let's call them A, B and C. They each have a .h and a .cpp file. All...
14
4409
by: Murkland | last post by:
Hi. I have a problem with a template class that I'm trying to inherit from. The code for the base class is: template <class T> class BaseClass { public: BaseClass(); ~BaseClass();
102
6683
by: hug | last post by:
www.webmaster, was suggested that this ng could be a better place.] I've updated my test server to handle if-modified-since. I've noticed that the (old copies I run of) IE and Netscape seem...
4
8853
by: alternativa | last post by:
Hi, I'd like to obtain an output looking as follows: name number phone address Caroline 233 34234 White St. 12 Anna 929043 093284 Brown St. 325...
3
2134
by: webEater | last post by:
Hey, I am writing a file that reads in an external file in the web and prints it out including the response header of the http protocol. I do this to enable cross domain XMLHttpRequests. I...
5
2204
by: Tio | last post by:
I have project in MFC(vc++) . There are files and classes: classes:dialog1,dialog2,aaa,bbb ---------------------- main.cpp --------------------- #include "mainfrm.h" #include "dialog1.h"...
7
1746
by: The Cool Giraffe | last post by:
I have the following: //A.h class A {}; //B.h #include "A.h" class B : A {};
1
7983
by: Proogeren | last post by:
I have a problem with a httpwebrequest that I am creating. The request in itself looks correct but using fiddler I see that a www-authentication header is sent along as well. The code is pasted...
0
7194
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6976
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.