how to use the Server.Transfer Method

Contributed by
Rating: 2 stars2 stars2 stars2 stars2 stars / 18
March 29, 2000
Rate this Article:
MEH MEH++


SEARCH ASP FREE
TOOLS YOU CAN USE

advertisement

Server.Transfer Method

Since 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.Execute

Server.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.
blog comments powered by Disqus
ASP CODE ARTICLES

- ASP Forms
- ASP: The Beginning
- Getting Remote Files With ASP Continued
- Inbox and Outbox Manipulation in ASP
- Relational DropDownList Using VB.NET
- Ad Tracking URL Hits
- Use ViewState to display one record per page...
- Send Email using ASP.NET formatted in HTML
- ASP File Explorer
- ASP/XML Interview questions by Srivatsan Sri...
- Pressing RETURN won't submit the form
- This shows how you get the TEXT of a combo r...
- Group Data by Adrian Forbes
- Multiple checkbox select sample
- Multiple checkbox select with all values sam...

ASP Web Hosting ASP.Net Web Hosting Windows Web Hosting
 
 
 

ASP Free Forums 
 RSS  Tutorials RSS
 RSS  Forums RSS
 RSS  All Feeds
Site Map 
Request Media Kit
Write For Us Get Paid 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Privacy Policy 
Support 


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 2 - Follow our Sitemap
Most Popular Topics
All ASP.Net Tutorials