Latest web development tutorials

ASP Transfer Methods

Server Object Reference Complete Server Object Reference

Transfer method to all status information in an ASP file created (all application / session variables and request all items in the collection) send (transfer) to another ASP file.

When the second ASP completed any time, it will not return to the first ASP page.

Note: Transfer method is an efficient alternative to the Response.Redirect.When the Server.Transfer method to execute another ASP page on the server transport, forced to redirect Web server to handle additional requests, avoiding the extra trouble.

grammar

Server.Transfer(path)

参数 描述
path 必需。ASP 文件的位置。向这个 ASP 文件转移控制权。

Examples

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>")
%>

输出:

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

See Server.Execute method, look at the difference between Server.Transfer and Server.Execute methods.


Server Object Reference Complete Server Object Reference