Open In App

ASP Server.Transfer() Method

Last Updated : 23 Dec, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

The ASP Server.Transfer Method is used to send all the information that has been created in one asp file to another .asp file. Note that the control will not return to the ASP page from where it was transferred when the second ASP page completes executing its tasks. The transfer includes built-in objects state information. 

Syntax:

Server.Transfer( path )

Parameter Values: This property accepts a single parameter as mentioned above and described below:

  • path: It defines the location of the .asp file to which control should be transferred. It is a required parameter.

Example: Below example demonstrates the method by transferring control from one file to the other.

GFG.asp: This file contains the Server.Transfer() method to transfer the control to the Sudo.asp file.




<%
response.write("Contents of the GFG file<br>")
Server.Transfer("Sudo.asp")
response.write("Line 2 in File 1<br>")
%>


Sudo.asp: This is the file that the transfer would be handed over to.




<%
response.write("Contents of the Sudo.asp<br>")
response.write("Line 2 in File 2<br>")
%>


Output:

Contents of the GFG.asp
Contents of the Sudo.asp
Line 2 in File 2

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads