ASP TransferMethod


Server 对象参考手册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 completes, it does not return to the first ASP page.

Note:The Transfer method is an efficient alternative to Response.Redirect. Where the Server.Transfer method transfers execution to another ASP page on the server, redirect forces the Web server to process an additional request, avoiding extra round trips.

Syntax

Server.Transfer(path)

Parameter Description
path Required. The location of the ASP file. Transfers control to this ASP file.

Example

File1.asp:

<%
response.write("Line 1 in File 1<br>")
Server.Transfer("file2.html")
response.write("Line 2 in File 1<br>")
%>

File2.asp:

<%
response.write("Line 1 in File 2<br>")
response.write("Line 2 in File 2<br>")
%>

Output:

Line 1 in File 1
Line 1 in File 2
Line 2 in File 2

Please refer to the Server.Execute method to understand the difference between the Server.Transfer and Server.Execute methods.


Server 对象参考手册Complete Server Object Reference Manual Other Extensions