By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,272 Members | 1,454 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,272 IT Pros & Developers. It's quick & easy.

Relative and Absolute Address

P: n/a
I recently began maintenance work on a production web server that is located
in the root directory of a web server. I moved this into a sub web on my
local web server in order to do work on it. I found that there is an include
file that references images:

<img src = "/images/Header.gif"

What worked correctly on the production server breaks on mine because of the
absolute address "/images". I removed the absolute address and changed that
to relative "images". This works in some cases but not in all because some
of the asp pages are in sub folders and all include the same include file.

I believe there is addressing like "~/" in .Net that would look in the web
application directory but this doesn't seem to work in asp. Does anyone have
a way to address a gif file from the web application level and not the web
server level?
Jul 19 '05 #1
Share this Question
Share on Google+
15 Replies


P: n/a
This has been (and still is) the most stupid behaviour ever introduced into IIS and it's been the
bane of my life for some time now. I usually resort to a number of mechanisms to find the correct
reference to the root of the web application (as opposed to site) and *never* use root relative
url - not least of all because it breaks the capability to do local server-side debugging.

You'll have to dig in and replace all those references with either relative references or some
variable reference that replaces the first '/' with the *real* url required.

AFAIK there isn't a simplistic replacement to the root '/' identifier in a url.

Chris
"Nick K." <no****@bogus.com> wrote in message news:e2**************@TK2MSFTNGP10.phx.gbl...
I recently began maintenance work on a production web server that is located
in the root directory of a web server. I moved this into a sub web on my
local web server in order to do work on it. I found that there is an include
file that references images:

<img src = "/images/Header.gif"

What worked correctly on the production server breaks on mine because of the
absolute address "/images". I removed the absolute address and changed that
to relative "images". This works in some cases but not in all because some
of the asp pages are in sub folders and all include the same include file.

I believe there is addressing like "~/" in .Net that would look in the web
application directory but this doesn't seem to work in asp. Does anyone have
a way to address a gif file from the web application level and not the web
server level?

Jul 19 '05 #2

P: n/a
When you say "sub web", do you mean a virtual directory? This should work as
expected if you mark it as such

Jeff

"Nick K." <no****@bogus.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
I recently began maintenance work on a production web server that is located in the root directory of a web server. I moved this into a sub web on my
local web server in order to do work on it. I found that there is an include file that references images:

<img src = "/images/Header.gif"

What worked correctly on the production server breaks on mine because of the absolute address "/images". I removed the absolute address and changed that to relative "images". This works in some cases but not in all because some
of the asp pages are in sub folders and all include the same include file.

I believe there is addressing like "~/" in .Net that would look in the web
application directory but this doesn't seem to work in asp. Does anyone have a way to address a gif file from the web application level and not the web
server level?

Jul 19 '05 #3

P: n/a
"Nick K." wrote in message news:e2**************@TK2MSFTNGP10.phx.gbl...
: I recently began maintenance work on a production web server that is
located
: in the root directory of a web server. I moved this into a sub web on my
: local web server in order to do work on it. I found that there is an
include
: file that references images:
:
: <img src = "/images/Header.gif"
:
: What worked correctly on the production server breaks on mine because of
the
: absolute address "/images". I removed the absolute address and changed
that
: to relative "images". This works in some cases but not in all because some
: of the asp pages are in sub folders and all include the same include file.
:
: I believe there is addressing like "~/" in .Net that would look in the web
: application directory but this doesn't seem to work in asp. Does anyone
have
: a way to address a gif file from the web application level and not the web
: server level?

Is this ASP or HTML?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #4

P: n/a
"Chris Barber" wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
: This has been (and still is) the most stupid behaviour ever introduced
into IIS and it's been the
: bane of my life for some time now. I usually resort to a number of
mechanisms to find the correct
: reference to the root of the web application (as opposed to site) and
*never* use root relative
: url - not least of all because it breaks the capability to do local
server-side debugging.
:
: You'll have to dig in and replace all those references with either
relative references or some
: variable reference that replaces the first '/' with the *real* url
required.
:
: AFAIK there isn't a simplistic replacement to the root '/' identifier in a
url.

So, you're saying "images/someimage.gif" tells you what level "images" is
located at and "/images/someimage.gif" is too difficult to work with?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #5

P: n/a
Nick K. wrote:
I recently began maintenance work on a production web server that is located
in the root directory of a web server. I moved this into a sub web on my
local web server in order to do work on it. I found that there is an include
file that references images:

<img src = "/images/Header.gif"

What worked correctly on the production server breaks on mine because of the
absolute address "/images". I removed the absolute address and changed that
to relative "images". This works in some cases but not in all because some
of the asp pages are in sub folders and all include the same include file.

I believe there is addressing like "~/" in .Net that would look in the web
application directory but this doesn't seem to work in asp. Does anyone have
a way to address a gif file from the web application level and not the web
server level?

This isn't an ASP problem as such, it is an HTML one.

Using relative URLs will solve this, e.g.

If the script is in a folder on the root of the web called ASP, and the
images folder is level with it, use:

<img src = "../images/Header.gif"

If the script is on the root and image in the images folder, use

<img src = "images/Header.gif"

etc.

This will work in subfolders because the link is relative to the script
where it appears
--

ca******************************@hotmail.com

(remove Tony Blair from office to contact me)
Jul 19 '05 #6

P: n/a
I suppose this is both a ASP and HTML problem. Relative addressing won't
work because of the design of an include file. The include file is included
in ASP pages in both the web application root and folders within the web
application. What I am looking for is relative addressing from the web
application root and not the web site root.

"Captain Flack" <ca***********@trumpton-firebrigade.dontevenbother> wrote in
message news:40**********************@news.easynet.co.uk.. .
Nick K. wrote:
I recently began maintenance work on a production web server that is located in the root directory of a web server. I moved this into a sub web on my
local web server in order to do work on it. I found that there is an include file that references images:

<img src = "/images/Header.gif"

What worked correctly on the production server breaks on mine because of the absolute address "/images". I removed the absolute address and changed that to relative "images". This works in some cases but not in all because some of the asp pages are in sub folders and all include the same include file.
I believe there is addressing like "~/" in .Net that would look in the web application directory but this doesn't seem to work in asp. Does anyone have a way to address a gif file from the web application level and not the web server level?

This isn't an ASP problem as such, it is an HTML one.

Using relative URLs will solve this, e.g.

If the script is in a folder on the root of the web called ASP, and the
images folder is level with it, use:

<img src = "../images/Header.gif"

If the script is on the root and image in the images folder, use

<img src = "images/Header.gif"

etc.

This will work in subfolders because the link is relative to the script
where it appears
--

ca******************************@hotmail.com

(remove Tony Blair from office to contact me)

Jul 19 '05 #7

P: n/a
And what mechanisms might those be?

"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
This has been (and still is) the most stupid behaviour ever introduced into IIS and it's been the bane of my life for some time now. I usually resort to a number of mechanisms to find the correct reference to the root of the web application (as opposed to site) and *never* use root relative url - not least of all because it breaks the capability to do local server-side debugging.
You'll have to dig in and replace all those references with either relative references or some variable reference that replaces the first '/' with the *real* url required.
AFAIK there isn't a simplistic replacement to the root '/' identifier in a url.
Chris
"Nick K." <no****@bogus.com> wrote in message news:e2**************@TK2MSFTNGP10.phx.gbl... I recently began maintenance work on a production web server that is located in the root directory of a web server. I moved this into a sub web on my
local web server in order to do work on it. I found that there is an include file that references images:

<img src = "/images/Header.gif"

What worked correctly on the production server breaks on mine because of the absolute address "/images". I removed the absolute address and changed that to relative "images". This works in some cases but not in all because some
of the asp pages are in sub folders and all include the same include file.

I believe there is addressing like "~/" in .Net that would look in the web
application directory but this doesn't seem to work in asp. Does anyone have a way to address a gif file from the web application level and not the web
server level?

Jul 19 '05 #8

P: n/a
"Nick K." wrote in message news:uJ**************@TK2MSFTNGP11.phx.gbl...
: I suppose this is both a ASP and HTML problem. Relative addressing won't
: work because of the design of an include file. The include file is
included
: in ASP pages in both the web application root and folders within the web
: application. What I am looking for is relative addressing from the web
: application root and not the web site root.

Using "images/someimage.gif" you don't know where you are, unless the
application only references folders below the application root level.
Using "../images/someimage.gif" is no different and ridiculous if "images"
is a child to the current directory when "images" will do.
You can also use "./images/someimage.gif" but it is the same as the first
one and a waste of two characters.
If you want to know where the application root is, at all times, then...

dim appPath
appPath = "/my/app/root/is/located/here/"

Now to call for images:

appPath & "images/someimage.gif"

The effective app root would be:
/my/app/root/is/located/here/images/someimage.gif
However, if your folder levels are not that deep, you can eliminate any
processing and just use web root relative paths, which you said you don't
want to do.

I use web root virtual paths directly unless I have folders multiple levels
deep.

"/images/someimage.gif"

dim imgPath
imgPath = "/dev/appName/images/"

You can now just prepend imgPath with the image name.
The biggest benefit to the second is changing path info from development to
production. All I need to modify is imgPath value, which is located in a
common file that is included in other pages. This also works well for
themes, skins, etc.

HTH...

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #9

P: n/a
"Roland Hall" <nobody@nowhere> wrote in message
news:u%****************@tk2msftngp13.phx.gbl...
Is this ASP or HTML?


Rolland !? You're in here too. I think we both must have too much time on
our hands to hang out in all these places :-)

I mostly just read messages in this group and the "*.asp.db" group but don't
post much to keep the foot-in-mouth thing to a minimum.

Nick mentioned "sub-webs" and I think that is key since IIS has no such
thing. I believe that was a FrontPage concept, while IIS only has Sites and
Virtual Folders. I think Jeff Dillon hit on it by suggesting that this
"web" isn't in it's own unique Virtual Folder which causes the Application
Root to be in the wrong place. I'd probably have to play around with it here
for a bit to verify that.

--

Phillip Windell [MCP, MVP, CCNA]
www.wandtv.com
Jul 19 '05 #10

P: n/a
Just make it a virtual directory, as I suggested.

Jef

"Nick K." <no****@bogus.com> wrote in message
news:uJ**************@TK2MSFTNGP11.phx.gbl...
I suppose this is both a ASP and HTML problem. Relative addressing won't
work because of the design of an include file. The include file is included in ASP pages in both the web application root and folders within the web
application. What I am looking for is relative addressing from the web
application root and not the web site root.

"Captain Flack" <ca***********@trumpton-firebrigade.dontevenbother> wrote in message news:40**********************@news.easynet.co.uk.. .
Nick K. wrote:
I recently began maintenance work on a production web server that is located in the root directory of a web server. I moved this into a sub web on my local web server in order to do work on it. I found that there is an include file that references images:

<img src = "/images/Header.gif"

What worked correctly on the production server breaks on mine because
of
the absolute address "/images". I removed the absolute address and changed that to relative "images". This works in some cases but not in all because some of the asp pages are in sub folders and all include the same include file.
I believe there is addressing like "~/" in .Net that would look in the web application directory but this doesn't seem to work in asp. Does
anyone
have a way to address a gif file from the web application level and not the web server level?

This isn't an ASP problem as such, it is an HTML one.

Using relative URLs will solve this, e.g.

If the script is in a folder on the root of the web called ASP, and the
images folder is level with it, use:

<img src = "../images/Header.gif"

If the script is on the root and image in the images folder, use

<img src = "images/Header.gif"

etc.

This will work in subfolders because the link is relative to the script
where it appears
--

ca******************************@hotmail.com

(remove Tony Blair from office to contact me)


Jul 19 '05 #11

P: n/a
"Phillip Windell" <@.> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
: "Roland Hall" <nobody@nowhere> wrote in message
: news:u%****************@tk2msftngp13.phx.gbl...
: > Is this ASP or HTML?
:
: Rolland !? You're in here too. I think we both must have too much time on
: our hands to hang out in all these places :-)

I try not to hang out in public. (O;= I currently have one network install
and config that is taking forever for them to get the products in, WITH
licensing CALs, NAV Corp. The router was done last week! So, some time
coming from there. Running small calls in between, one development project
in 2nd phase and two others past 1/2 way mark. Waiting to hear on two
additional projects, one could be extensive so you're right, I've got
t-t-t-t-too much time on my hands.

: I mostly just read messages in this group and the "*.asp.db" group but
don't
: post much to keep the foot-in-mouth thing to a minimum.

No foot, no glory.

: Nick mentioned "sub-webs" and I think that is key since IIS has no such
: thing. I believe that was a FrontPage concept, while IIS only has Sites
and
: Virtual Folders. I think Jeff Dillon hit on it by suggesting that this
: "web" isn't in it's own unique Virtual Folder which causes the Application
: Root to be in the wrong place. I'd probably have to play around with it
here
: for a bit to verify that.

HOW TO: Create a Virtual Folder (Subweb) in IIS 4.0 or IIS 5.0
http://support.microsoft.com/default...301392&sd=tech

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #12

P: n/a
A root relative path e.g.:

'/images'

when called from a virtual directory still references from the root of the *website*, not the root
of the virtual directory (as might be expected).

It's a RRPITA (Right Royal Pain In The ...) and breaks almost all aspects of doing 'local-mode' ASP
debugging (where a website will be moved to a virtual directory on the local IIS).

My advice ... don't *ever* use them, user relative paths or a script to determine the root of the
'site' (e.g. your virtual directory) and path references from that.

Chris.

"Jeff Dillon" <je**@removemeemergencyreporting.com> wrote in message
news:uA*************@TK2MSFTNGP09.phx.gbl...
Just make it a virtual directory, as I suggested.

Jef

"Nick K." <no****@bogus.com> wrote in message
news:uJ**************@TK2MSFTNGP11.phx.gbl...
I suppose this is both a ASP and HTML problem. Relative addressing won't
work because of the design of an include file. The include file is included in ASP pages in both the web application root and folders within the web
application. What I am looking for is relative addressing from the web
application root and not the web site root.

"Captain Flack" <ca***********@trumpton-firebrigade.dontevenbother> wrote in message news:40**********************@news.easynet.co.uk.. .
Nick K. wrote:
I recently began maintenance work on a production web server that is located in the root directory of a web server. I moved this into a sub web on my local web server in order to do work on it. I found that there is an include file that references images:

<img src = "/images/Header.gif"

What worked correctly on the production server breaks on mine because
of
the absolute address "/images". I removed the absolute address and changed that to relative "images". This works in some cases but not in all because some of the asp pages are in sub folders and all include the same include file.
I believe there is addressing like "~/" in .Net that would look in the web application directory but this doesn't seem to work in asp. Does
anyone
have a way to address a gif file from the web application level and not the web server level?

This isn't an ASP problem as such, it is an HTML one.

Using relative URLs will solve this, e.g.

If the script is in a folder on the root of the web called ASP, and the
images folder is level with it, use:

<img src = "../images/Header.gif"

If the script is on the root and image in the images folder, use

<img src = "images/Header.gif"

etc.

This will work in subfolders because the link is relative to the script
where it appears
--

ca******************************@hotmail.com

(remove Tony Blair from office to contact me)



Jul 19 '05 #13

P: n/a
Not to mention that Server.MapPath seems to map to the root of the site,
which could be in a completely different location, then simply appends the
'tree' from your virtual directory down. Like you say - a real pain.

"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:ev****************@TK2MSFTNGP09.phx.gbl...
A root relative path e.g.:

'/images'

when called from a virtual directory still references from the root of the *website*, not the root of the virtual directory (as might be expected).

It's a RRPITA (Right Royal Pain In The ...) and breaks almost all aspects of doing 'local-mode' ASP debugging (where a website will be moved to a virtual directory on the local IIS).
My advice ... don't *ever* use them, user relative paths or a script to determine the root of the 'site' (e.g. your virtual directory) and path references from that.

Chris.

"Jeff Dillon" <je**@removemeemergencyreporting.com> wrote in message
news:uA*************@TK2MSFTNGP09.phx.gbl...
Just make it a virtual directory, as I suggested.

Jef

"Nick K." <no****@bogus.com> wrote in message
news:uJ**************@TK2MSFTNGP11.phx.gbl...
I suppose this is both a ASP and HTML problem. Relative addressing won't
work because of the design of an include file. The include file is included
in ASP pages in both the web application root and folders within the web
application. What I am looking for is relative addressing from the web
application root and not the web site root.

"Captain Flack" <ca***********@trumpton-firebrigade.dontevenbother> wrote in
message news:40**********************@news.easynet.co.uk.. .
Nick K. wrote:

> I recently began maintenance work on a production web server that is located
> in the root directory of a web server. I moved this into a sub web on my > local web server in order to do work on it. I found that there is an include
> file that references images:
>
> <img src = "/images/Header.gif"
>
> What worked correctly on the production server breaks on mine
because of
the
> absolute address "/images". I removed the absolute address and

changed that
> to relative "images". This works in some cases but not in all
because some
> of the asp pages are in sub folders and all include the same include

file.
>
> I believe there is addressing like "~/" in .Net that would look in
the web
> application directory but this doesn't seem to work in asp. Does anyone
have
> a way to address a gif file from the web application level and not

the web
> server level?
>
>
This isn't an ASP problem as such, it is an HTML one.

Using relative URLs will solve this, e.g.

If the script is in a folder on the root of the web called ASP, and

the images folder is level with it, use:

<img src = "../images/Header.gif"

If the script is on the root and image in the images folder, use

<img src = "images/Header.gif"

etc.

This will work in subfolders because the link is relative to the script where it appears
--

ca******************************@hotmail.com

(remove Tony Blair from office to contact me)



Jul 19 '05 #14

P: n/a
> Not to mention that Server.MapPath seems to map to the root of the site,
which could be in a completely different location, then simply appends the
'tree' from your virtual directory down. Like you say - a real pain.
I've heard this comment before but I have never been able to duplicate it.
For example:

localhost => c:\inetpub\wwwroot
localhost/wbtmanager => c:\wbtman\web

The following code:

response.write server.MapPath("/wbtmanager/test.asp") & "<br>"
response.write server.MapPath("./test.asp") & "<br>"

displays:

C:\wbtman\web\test.asp
C:\wbtman\web\test.asp

Which is what I would expect.

Maybe I'm missing something. Can you give an example of where MapPath
prepends the path to the site rather than the path to the virtual directory?

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Alan Howard" <Xa***********@Xparadise.net.nzX> wrote in message
news:On**************@TK2MSFTNGP10.phx.gbl... Not to mention that Server.MapPath seems to map to the root of the site,
which could be in a completely different location, then simply appends the
'tree' from your virtual directory down. Like you say - a real pain.

"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:ev****************@TK2MSFTNGP09.phx.gbl...
A root relative path e.g.:

'/images'

when called from a virtual directory still references from the root of the
*website*, not the root
of the virtual directory (as might be expected).

It's a RRPITA (Right Royal Pain In The ...) and breaks almost all
aspects of doing 'local-mode' ASP
debugging (where a website will be moved to a virtual directory on the

local IIS).

My advice ... don't *ever* use them, user relative paths or a script to

determine the root of the
'site' (e.g. your virtual directory) and path references from that.

Chris.

"Jeff Dillon" <je**@removemeemergencyreporting.com> wrote in message
news:uA*************@TK2MSFTNGP09.phx.gbl...
Just make it a virtual directory, as I suggested.

Jef

"Nick K." <no****@bogus.com> wrote in message
news:uJ**************@TK2MSFTNGP11.phx.gbl...
I suppose this is both a ASP and HTML problem. Relative addressing won't work because of the design of an include file. The include file is

included
in ASP pages in both the web application root and folders within the web application. What I am looking for is relative addressing from the web
application root and not the web site root.

"Captain Flack" <ca***********@trumpton-firebrigade.dontevenbother>

wrote
in
message news:40**********************@news.easynet.co.uk.. .
> Nick K. wrote:
>
> > I recently began maintenance work on a production web server that is located
> > in the root directory of a web server. I moved this into a sub web

on
my
> > local web server in order to do work on it. I found that there is an include
> > file that references images:
> >
> > <img src = "/images/Header.gif"
> >
> > What worked correctly on the production server breaks on mine

because
of
the
> > absolute address "/images". I removed the absolute address and

changed that
> > to relative "images". This works in some cases but not in all because some
> > of the asp pages are in sub folders and all include the same include file.
> >
> > I believe there is addressing like "~/" in .Net that would look in the web
> > application directory but this doesn't seem to work in asp. Does

anyone
have
> > a way to address a gif file from the web application level and not the web
> > server level?
> >
> >
> This isn't an ASP problem as such, it is an HTML one.
>
> Using relative URLs will solve this, e.g.
>
> If the script is in a folder on the root of the web called ASP, and the > images folder is level with it, use:
>
> <img src = "../images/Header.gif"
>
> If the script is on the root and image in the images folder, use
>
> <img src = "images/Header.gif"
>
> etc.
>
> This will work in subfolders because the link is relative to the script > where it appears
>
>
> --
>
> ca******************************@hotmail.com
>
> (remove Tony Blair from office to contact me)



Jul 19 '05 #15

P: n/a
You appear to be correct..just tried it.

"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
A root relative path e.g.:

'/images'

when called from a virtual directory still references from the root of the *website*, not the root of the virtual directory (as might be expected).

It's a RRPITA (Right Royal Pain In The ...) and breaks almost all aspects of doing 'local-mode' ASP debugging (where a website will be moved to a virtual directory on the local IIS).
My advice ... don't *ever* use them, user relative paths or a script to determine the root of the 'site' (e.g. your virtual directory) and path references from that.

Chris.

"Jeff Dillon" <je**@removemeemergencyreporting.com> wrote in message
news:uA*************@TK2MSFTNGP09.phx.gbl...
Just make it a virtual directory, as I suggested.

Jef

"Nick K." <no****@bogus.com> wrote in message
news:uJ**************@TK2MSFTNGP11.phx.gbl...
I suppose this is both a ASP and HTML problem. Relative addressing won't
work because of the design of an include file. The include file is included
in ASP pages in both the web application root and folders within the web
application. What I am looking for is relative addressing from the web
application root and not the web site root.

"Captain Flack" <ca***********@trumpton-firebrigade.dontevenbother> wrote in
message news:40**********************@news.easynet.co.uk.. .
Nick K. wrote:

> I recently began maintenance work on a production web server that is located
> in the root directory of a web server. I moved this into a sub web on my > local web server in order to do work on it. I found that there is an include
> file that references images:
>
> <img src = "/images/Header.gif"
>
> What worked correctly on the production server breaks on mine
because of
the
> absolute address "/images". I removed the absolute address and

changed that
> to relative "images". This works in some cases but not in all
because some
> of the asp pages are in sub folders and all include the same include

file.
>
> I believe there is addressing like "~/" in .Net that would look in
the web
> application directory but this doesn't seem to work in asp. Does anyone
have
> a way to address a gif file from the web application level and not

the web
> server level?
>
>
This isn't an ASP problem as such, it is an HTML one.

Using relative URLs will solve this, e.g.

If the script is in a folder on the root of the web called ASP, and

the images folder is level with it, use:

<img src = "../images/Header.gif"

If the script is on the root and image in the images folder, use

<img src = "images/Header.gif"

etc.

This will work in subfolders because the link is relative to the script where it appears
--

ca******************************@hotmail.com

(remove Tony Blair from office to contact me)



Jul 19 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.