473,379 Members | 1,544 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Relative and Absolute Address

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
15 2877
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
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
"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
"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
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
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
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
"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
"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
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
"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
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
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
> 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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: mark | last post by:
I am designing a website at the moment and looking at the difference between relative and absolute url links which is driving me crazy! I would like to use relative paths, but it is proving very...
3
by: Gilles Lenfant | last post by:
Hi, I'm sometimes brain dead for a simple problem like this one : Given an origin absolute URL and a destination absolute URL, I want to make a relative path from the origin to the...
24
by: sinister | last post by:
After doing a websearch, it appears that it's OK to omit the "http:" to form a relative URL. Are there any pitfalls to this? For example, if there is a page http://www.domain1.com/page1.html...
2
by: Catherine Lynn Wood | last post by:
I need to know how to overlap DIV content within 'relative' associated rendering. I am building div layers in the middle of a page and when I set positioning to absolute in the CSS, it references...
2
by: Simon Harvey | last post by:
Hi everyone, This is probably a pretty stupid question but does anyone know if its possible to use relative addressing when it comes to accessing an image of the file system? In particular, I...
8
by: JJ | last post by:
I'm confused about paths. I have a functionn that uses the mappath method, which I think requires a virtual path (is that the same as a relative path?). But this doesn't always work as the...
1
by: ax | last post by:
Dear Experts, I really worry about the following problem.. There is one XML File on my PC located at C:\Test. Hence, there are 2 XSD files on the same path I make an absolut reference in the...
3
by: yan | last post by:
Hello everybody, I am new so this is the occasion to say hello to everybody. I have a problem with absolute/relative paths. I have to create a static documentation in html for a project and I have...
15
by: Lars Eighner | last post by:
Aside from the deaths of a few extra electrons to spell out the whole root relative path, is there any down side? It seems to me that theoretically it shouldn't make any difference, and it would...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.