ASP Transfer Method
Complete Server Object Reference Manual
The Transfer method sends (transfers) all state information created in one ASP file (all application/session variables and all items in the request collections) to another ASP file.
When the second ASP finishes, it does not return to the first ASP page.
**Note:** The Transfer method is an efficient alternative to Response.Redirect. When Server.Transfer transfers execution to another ASP page on the server, it avoids the extra round trip in which redirection forces the Web server to process an additional request.
Syntax
Server.Transfer(path)
| Parameters | Description |
|---|---|
| path | Required. The location of the ASP file to which control is transferred. |
Example
File1.asp:
<%
response.write("Line 1 in File 1
")
Server.Transfer("file2.html")
response.write("Line 2 in File 1
")
%>
File2.asp:
<%
response.write("Line 1 in File 2
")
response.write("Line 2 in File 2
")
%>
Output:
Line 1 in File 1
Line 1 in File 2
Line 2 in File 2
See the Server.Execute method to learn about the difference between Server.Transfer and Server.Execute.
Complete Server Object Reference Manual