469,950 Members | 2,349 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

Absolute/Virtual Path for images

Rob
I have a web project that has multiple directories. Some of the files in
different directories use the same include files. The problem is that these
include files also reference an image folder. I am trying to create an
absolute reference to these images so I don't have to make the same include
for different directories. What is the best way to do this?

Thanks.

Jul 22 '05 #1
4 3998
Rob wrote on 08 mrt 2005 in microsoft.public.inetserver.asp.general:
I have a web project that has multiple directories. Some of the files
in different directories use the same include files. The problem is
that these include files also reference an image folder. I am trying
to create an absolute reference to these images so I don't have to
make the same include for different directories. What is the best way
to do this?

Just define them absolute absolutely:

<img src="/mydir/mydirToo/myimg.jpg">
so I don't have to make the same include for different directories.


You mean ".. different includes for different ..." , I suppose?

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 22 '05 #2

<image src="/images/yourimage.gif">

"/..." always relates to the root.

"Rob" <ro*@nospam.com> wrote in message
news:Zb********************@speakeasy.net...
I have a web project that has multiple directories. Some of the files in
different directories use the same include files. The problem is that these include files also reference an image folder. I am trying to create an
absolute reference to these images so I don't have to make the same include for different directories. What is the best way to do this?

Thanks.

Jul 22 '05 #3
Rob
/images does not work. Any ideas why?

Thanks.

"Dave" <no*@nospam.com> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...

<image src="/images/yourimage.gif">

"/..." always relates to the root.

"Rob" <ro*@nospam.com> wrote in message
news:Zb********************@speakeasy.net...
I have a web project that has multiple directories. Some of the files in
different directories use the same include files. The problem is that

these
include files also reference an image folder. I am trying to create an
absolute reference to these images so I don't have to make the same

include
for different directories. What is the best way to do this?

Thanks.



Jul 22 '05 #4
"Rob" wrote in message news:Zb********************@speakeasy.net...
:I have a web project that has multiple directories. Some of the files in
: different directories use the same include files. The problem is that
these
: include files also reference an image folder. I am trying to create an
: absolute reference to these images so I don't have to make the same
include
: for different directories. What is the best way to do this?

Hi Rob...

It would be helpful to know what your subdirectory names are but as an
example, here is what I do.

I create a config.asp file. This is where I put customized variables.
I also create a common.asp file and a header.asp file.
In the common.asp, I put common subs/functions that I use throughout my
site.
In header.asp is where I put the header I use on each page and I link in my
common.asp which links in my config.asp.

' o--> config.asp <--o
<%
Option Explicit
Response.Buffer = True

Const imgPath = "/images/"
..
..
..
%>

' o--> common.asp <--o
<!--#include virtual="/asp/config.asp"-->
<%
sub prt(str)
Response.Write str & vbCrLf
end sub

sub lprt(str)
Response.Write str & "<br />" & vbCrLf
end sub

function someFunction(someValue)
..
..
end function
..
..
%>

' o--> header.asp <--o
<!--#include virtual="/asp/common.asp"-->
<%
..
..
..
%>

' o--> All other pages <--o
<%@ Language="VBScript" %>
<%
Option Explicit
Response.Buffer = True
%>
<!--#include virtual="/asp/header.asp"-->
<%
..
..

prt "<div><span><img id=""img1"" class=""blockImages"" src=""" & imgPath &
"myimage.jpg"" /></span></div>"
%>

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 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Peter Taurins | last post: by
9 posts views Thread by Stuart | last post: by
19 posts views Thread by Jerry M. Gartner | last post: by
9 posts views Thread by Pumkin | last post: by
6 posts views Thread by Jon Slaughter | last post: by
2 posts views Thread by Adam Right | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.