Server.Transfer and image path

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kevin Vogler

    Server.Transfer and image path

    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.Redire ct 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


  • Ray at

    #2
    Re: Server.Transfer and image path

    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" <kvogler@vogler andassociates.c om> wrote in message
    news:uaPveIeWDH A.2476@tk2msftn gp13.phx.gbl...[color=blue]
    > 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.Redire ct to a page in the subdirectory the images are fine but[/color]
    when[color=blue]
    > 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
    >
    >[/color]


    Comment

    • Kevin Vogler

      #3
      Re: Server.Transfer and image path

      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:%23%23vwIc fWDHA.2100@TK2M SFTNGP11.phx.gb l...[color=blue]
      > Not sure why that would be happening if the page you're transferring to[/color]
      has[color=blue]
      > 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" <kvogler@vogler andassociates.c om> wrote in message
      > news:uaPveIeWDH A.2476@tk2msftn gp13.phx.gbl...[color=green]
      > > I have a subdirectory with it's own images folder. All the image paths[/color][/color]
      in[color=blue][color=green]
      > > the pages in the sub directory are "image/image.jpg" When I
      > > Response.Redire ct to a page in the subdirectory the images are fine but[/color]
      > when[color=green]
      > > 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
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • grw

        #4
        Re: Server.Transfer and image path

        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" <kvogler@vogler andassociates.c om> wrote in message
        news:#v83qrfWDH A.1896@TK2MSFTN GP12.phx.gbl...[color=blue]
        > 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:%23%23vwIc fWDHA.2100@TK2M SFTNGP11.phx.gb l...[color=green]
        > > Not sure why that would be happening if the page you're transferring to[/color]
        > has[color=green]
        > > 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[/color][/color]
        from[color=blue][color=green]
        > > the root of your site in all your pages.
        > >
        > > Ray at home
        > >
        > > --
        > > Will trade ASP help for SQL Server help
        > >
        > >
        > > "Kevin Vogler" <kvogler@vogler andassociates.c om> wrote in message
        > > news:uaPveIeWDH A.2476@tk2msftn gp13.phx.gbl...[color=darkred]
        > > > I have a subdirectory with it's own images folder. All the image[/color][/color][/color]
        paths[color=blue]
        > in[color=green][color=darkred]
        > > > the pages in the sub directory are "image/image.jpg" When I
        > > > Response.Redire ct to a page in the subdirectory the images are fine[/color][/color][/color]
        but[color=blue][color=green]
        > > when[color=darkred]
        > > > 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
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Kevin Vogler

          #5
          Re: Server.Transfer and image path

          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.ServerV ariables("SERVE R_NAME")

          Select Case strServerName
          Case "www.domain1.co m"
          Response.redire ct("domain1/default.asp")
          Case "www.domain2.or g"
          Response.redire ct("domain2/default.asp")
          Case Else
          Response.Redire ct("bad.asp")
          End Select

          Code Ex B
          Dim strServerName
          strServerName = Request.ServerV ariables("SERVE R_NAME")

          Select Case strServerName
          Case "www.domain1.co m"
          Server.Transfer ("domain1/default.asp")
          Case "www.domain2.or g"
          Server.Transfer ("domain2/default.asp")
          Case Else
          Response.Redire ct("bad.asp")
          End Select

          Thanks
          Kevin Vogler


          Comment

          • grw

            #6
            Re: Server.Transfer and image path

            Use <img src="/images/Logo.jpg" width="178" height="60">



            "Kevin Vogler" <kvogler@vogler andassociates.c om> wrote in message
            news:ODNv10gWDH A.384@TK2MSFTNG P12.phx.gbl...[color=blue]
            > 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[/color]
            so[color=blue]
            > 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.ServerV ariables("SERVE R_NAME")
            >
            > Select Case strServerName
            > Case "www.domain1.co m"
            > Response.redire ct("domain1/default.asp")
            > Case "www.domain2.or g"
            > Response.redire ct("domain2/default.asp")
            > Case Else
            > Response.Redire ct("bad.asp")
            > End Select
            >
            > Code Ex B
            > Dim strServerName
            > strServerName = Request.ServerV ariables("SERVE R_NAME")
            >
            > Select Case strServerName
            > Case "www.domain1.co m"
            > Server.Transfer ("domain1/default.asp")
            > Case "www.domain2.or g"
            > Server.Transfer ("domain2/default.asp")
            > Case Else
            > Response.Redire ct("bad.asp")
            > End Select
            >
            > Thanks
            > Kevin Vogler
            >
            >[/color]


            Comment

            Working...