ASP Transfer Attribute
Definition and Usage
The Transfer method sends (transfers) all state information created in one ASP file (all application/session variables and all items in the request collection) to another ASP file.
When the second ASP completes any action, it does not return to the first ASP page.
Note:The Transfer method is an efficient alternative to Response.Redirect. Redirection forces the Web server to handle an additional request, while Server.Transfer transfers execution to another ASP page on the server, avoiding additional complications.
Syntax
Server.Transfer(path)
Parameter | Description |
---|---|
Path | Required. The location of the ASP file. Transfer control to this ASP file. |
Example
File1.asp:
<% response.write("Line 1 in File 1<br />") Server.Transfer("file2.asp") 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