Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Redirect question

Redirect question

Scheduled Pinned Locked Moved Web Development
questioncsharpc++comagentic-ai
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tom Archer
    wrote on last edited by
    #1

    How can I redirect a user to another page and not have the second page's URL show up in the browser's address bar. For example, let's say I want the user to type in http://www.server1.com/agent and for the default.asp page to redirect to http://www.server2.com/agent. I don't want the user to see that they're on server2. Can this be done? Cheers, Tom Archer Author - Inside C#, Visual C++.NET Bible

    A M 2 Replies Last reply
    0
    • T Tom Archer

      How can I redirect a user to another page and not have the second page's URL show up in the browser's address bar. For example, let's say I want the user to type in http://www.server1.com/agent and for the default.asp page to redirect to http://www.server2.com/agent. I don't want the user to see that they're on server2. Can this be done? Cheers, Tom Archer Author - Inside C#, Visual C++.NET Bible

      A Offline
      A Offline
      AliDogDog
      wrote on last edited by
      #2

      Tom, Response.Redirect puts a code in the HTTP header that is sent back to the requesting browser that tells the browser to request the next page. That means you've made a roundtrip (to the server, which is expensive) and the URL will show up in the browser's address bar. You might be able to use the Server.Transfer method if your site is running on IIS 5. Server.Transfer actually serves up the new file behind the scenes, it's all done server-side. The original URL will remain in the browser's address bar. Server.Transfer, however, is not a silver bullet. For one thing, you can't append a querystring. You can't Server.Transfer outside of your site. When you call Server.Transfer, the state information for all the built-in objects will be included in the transfer. This means that any variables or objects that have been assigned a value in session or application scope will be maintained. In addition, all of the current contents for the request collections will be available to the .asp file receiving the transfer. If the path you specify in the input parameter is for an .asp file in another application, the .asp file will execute as if it were in the application that contains the Server.Transfer command. In other words, all variables and objects that have been given application scope either by other .asp files in the application or by the application's Global.asa file will be available to the called .asp file. However, the path parameter must not contain an query string or ASP returns an error. Server.Transfer acts as an efficient replacement for Response.Redirect. Response.Redirect tells the browser to request a different page. Since a redirect forces a new page request, the browser has to make two round trips to the Web server, and the Web server has to handle an extra request. IIS 5.0 introduced a new function, Server.Transfer, which transfers execution to a different ASP page on the server. This avoids the extra round trip, resulting in better overall system performance, as well as a better user experience. Finally, if you can't use Server.Transfer (not using IIS 5), check out this article: Simulate Server.Execute and Server.Transfer in ASP 2.0 http://www.4guysfromrolla.com/ASPscripts/PrintPage.asp?REF=/webtech/042602-1.shtml Good Luck.

      1 Reply Last reply
      0
      • T Tom Archer

        How can I redirect a user to another page and not have the second page's URL show up in the browser's address bar. For example, let's say I want the user to type in http://www.server1.com/agent and for the default.asp page to redirect to http://www.server2.com/agent. I don't want the user to see that they're on server2. Can this be done? Cheers, Tom Archer Author - Inside C#, Visual C++.NET Bible

        M Offline
        M Offline
        Michela 0
        wrote on last edited by
        #3

        From "Professional Active Server Pages 3.0". In ASP 3.0 and IIS 5.0 we can avoid the need to use client-side redirection with 2 method : Execute and Transfer.They cause control to be passed immediately to another page which can be an ASP script page or something else. The difference between them is that Execute method 'calls' the other page, much like we call a subroutine. When the other page or resource has completed execution or streaming to the client, control pass back to the statement following the call to the Execute method in the original page, and execution continues from there. When we use the Transfer method, control does not pass back to the original page, and execution stops at the end of the page or resource we trasnferred control to. Hope it can be useful. Michela

        T 1 Reply Last reply
        0
        • M Michela 0

          From "Professional Active Server Pages 3.0". In ASP 3.0 and IIS 5.0 we can avoid the need to use client-side redirection with 2 method : Execute and Transfer.They cause control to be passed immediately to another page which can be an ASP script page or something else. The difference between them is that Execute method 'calls' the other page, much like we call a subroutine. When the other page or resource has completed execution or streaming to the client, control pass back to the statement following the call to the Execute method in the original page, and execution continues from there. When we use the Transfer method, control does not pass back to the original page, and execution stops at the end of the page or resource we trasnferred control to. Hope it can be useful. Michela

          T Offline
          T Offline
          Tom Archer
          wrote on last edited by
          #4

          Thanks Michela, However, Transfer displays the current url and Execute won't work on fully qualified urls. Therefore, I went with the frameset idea. Cheers, Tom Archer Author - Inside C#, Visual C++.NET Bible

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups