Server.Transfer MethodSince ASPFree is hosted on Windows 2000, we finally started to take advantage of the new features ASP 3.0 offers. One very simple one is Server.Transfer. This is a new server side redirection tool to other documents on your website. We were putting together our new components section, the old page viewers might have bookmarked we put a server.Transfer "NewComponentHomepage.asp" directive so when people go to view the old page they'll be redirected to the new page Thats it, in old asp pages you would have to used the <% Response.Redirect "newpage.asp" %> method. This would have meant a round trip the client then to the new page. Not anymore, the Server.Transfer just transfers the request to the new page without making the round trip to the client and back making it FASTER! Here is the code | Server.Transfer method code Here is the code 1. The Old page doing the Server.Transfer method. <% @Language="Vbscript" %> <% Server.Transfer "newpage.asp" %> 2. The new page <% @Language="vbscript" %> <html><head> <title>The New Page that was Directed too</title> <Body> This page was redirected to by Server.Transfer Method </body> </html> |
Difference between Server.transfer and Server.ExecuteServer.Execute transfers executing page to another asp page the focus goes back to the original page once its done. Although I've never used this method, I've not ran into a need to. Server.Transfer is a replacement option for response.redirect to files on the same server. This however i've used tons, saves round trips to the client and helps maintain good performance. |