473,785 Members | 2,756 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 2774
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
2759
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 = ImageCreate (100, 100); ..... (draw some stuff) .... ImagePNG( $img ); ?>
26
1679
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
2297
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 headers use the following construct to make sure the headers are not included multiple times: #ifndef _A_H_ #define _A_H_ class A {
14
4434
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
6821
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 never to send if-modified-since. But the strange thing is that Opera sends if-modified-since but when I reply with "HTTP/1.0 304 Not Modified" it is not refreshing the screen from its cache, it is leaving the screen blank.
4
8872
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 To do this (I mean to obtain constant field length for data of the same type, even if strings are of different lengths) I tried to use setw(X) from <iomanip.h>, so I wrote something like this:
3
2155
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 implemented it via fsockopen, like this: <? $url = $_REQUEST; // take the param as $uri //... more ...
5
2226
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" #include "dialog2.h"
7
1766
by: The Cool Giraffe | last post by:
I have the following: //A.h class A {}; //B.h #include "A.h" class B : A {};
1
8047
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 below. I do not add any www-authentication header here so I was wondering if anyone knows how to remove it. I have used almost 2 days trying to figure this out so help would be highly appreciated. CORRECT No proxy-authenticate header is present no...
0
9643
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9947
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6737
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.