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

Server.Transfer and image path

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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

--
Will trade ASP help for SQL Server help
"Kevin Vogler" <kv*****@voglerandassociates.com> wrote in message
news:ua**************@tk2msftngp13.phx.gbl...
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

Jul 19 '05 #2

P: n/a
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
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
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

--
Will trade ASP help for SQL Server help
"Kevin Vogler" <kv*****@voglerandassociates.com> wrote in message
news:ua**************@tk2msftngp13.phx.gbl...
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


Jul 19 '05 #3

P: n/a
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?
"Kevin Vogler" <kv*****@voglerandassociates.com> wrote in message
news:#v**************@TK2MSFTNGP12.phx.gbl...
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
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
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

--
Will trade ASP help for SQL Server help
"Kevin Vogler" <kv*****@voglerandassociates.com> wrote in message
news:ua**************@tk2msftngp13.phx.gbl...
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



Jul 19 '05 #4

P: n/a
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
Jul 19 '05 #5

P: n/a
grw
Use <img src="/images/Logo.jpg" width="178" height="60">

"Kevin Vogler" <kv*****@voglerandassociates.com> wrote in message
news:OD*************@TK2MSFTNGP12.phx.gbl...
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

Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.