Open In App

ASP Server.Transfer() Method

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:

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
Article Tags :