ASP » Server » Transfer

Version: 3.0

Syntax:
Server.Transfer (Path)
Path
The Path argument is a string specifying either the absolute or relative path of the ASP page being called. The file name must be included in the path. The entire Path must be enclosed inside a pair of quotes.


The Transfer method allows you to transfer all of the state information for all of the built-in objects from one ASP page to another. Unlike the Execute method, when the ASP page that you have transferred to is finished, you do not return the original ASP page.

The Transfer method allows you to transfer from inside one ASP page to another ASP page. All of the state information that has been created for the first (calling) ASP page will be transferred to the second (called) ASP page. This transfered information includes all objects and variables that have been given a value in an Application or Session scope, and all items in the Request collections. For example, the second ASP page will have the same SessionID as the first ASP page.

When the second (called) ASP page completes its tasks, you do not return to the first (calling) ASP page.

In contrast, the Execute method allows you to call another ASP page, and when the called page has completed its tasks, you return to the calling ASP page.

There is one mandatory argument.

Examples

Code:
----------CallingAsp.asp----------
<%
Application("name") = "Application Maker"
Application("publishdate") = "05/15/01"
Application("author") = "DevGuru"
Set Application("Obj1") = Server.CreateObject("ADODB.Connection")

Server.Transfer("CalledAsp.asp")
%>
Output:
Output from CalledAsp.asp
name=Application Maker
publishdate=05/15/01
author=DevGuru
OBJ1 is an object.
Explanation:

In this example, the first ASP page (CallingAsp.asp) has no output.

See Also: