Server.Transfer and image path

K

Kevin Vogler

I have a subdirectory with it's own images folder. All the image paths in
the pages in the sub directory are "image/image.jpg" When I
Response.Redirect to a page in the subdirectory the images are fine but when
I use Server.Transfer all the links are broken. I'd prefer to use the
relative paths. Is there a way around this in the Server.Transfer?

Many thanks
Kevin Vogler
 
R

Ray at

Not sure why that would be happening if the page you're transferring to has
correct image paths, but the one thing I could suggest is using
/dir/images/file.gif for your paths, like use a path that is absolute from
the root of your site in all your pages.

Ray at home
 
K

Kevin Vogler

Thanks for the reply. The image path is valid from where the page is but
not from where the Server.Transfer is initiated. I'm redirecting based on
the URL.

thanks
Kevin Vogler
 
G

grw

Right click on the image to get its path properties.
Compare this with an image that shows vs an image that doesnt.
What is the .transfer code used?
 
K

Kevin Vogler

When I do a show source it's identical whether it's code ex A or B. The
structure is at the root I have default.asp which has the code below. The
only way I can get it to work is if I put the images folder at the root.
Apparently, using Server.Transfer just loads the new page in the old page so
the references are all relative to the page with the transfer code. I'm
just looking if there's a way I can change the Server.Transfer so it will
deal with this.

sub directory domain1 has a images directory and a default.asp. The image
code in each default is:
<img src="images/Logo.jpg" width="178" height="60">

Code Ex A
Dim strServerName
strServerName = Request.ServerVariables("SERVER_NAME")

Select Case strServerName
Case "www.domain1.com"
Response.redirect("domain1/default.asp")
Case "www.domain2.org"
Response.redirect("domain2/default.asp")
Case Else
Response.Redirect("bad.asp")
End Select

Code Ex B
Dim strServerName
strServerName = Request.ServerVariables("SERVER_NAME")

Select Case strServerName
Case "www.domain1.com"
Server.Transfer("domain1/default.asp")
Case "www.domain2.org"
Server.Transfer("domain2/default.asp")
Case Else
Response.Redirect("bad.asp")
End Select

Thanks
Kevin Vogler
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top