当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP Execute 方法
The Execute method executes an ASP file from inside another ASP file. After executing the called .asp file, the control is returned to the original .asp file.
ASP Execute方法的作用是执行一个来自于其他ASP文件内部的ASP程序。当其他ASP文件内的程序被请求执行完毕之后,控制器将返回最初发出请求的原始ASP文件
Server.Execute(path) |
Parameter 参数 | Description 描述 |
---|---|
path | Required. The location of the ASP file to execute 必要参数。所请求执行的ASP文件的本机地址。 |
File1.asp: <% response.write("I am in File 1!<br />") Server.Execute("file2.asp") response.write("I am back in File 1!") %> File2.asp: <% response.write("I am in File 2!<br />") %> Output: I am in File 1! I am in File 2! I am back in File 1! |
Also look at the Server.Transfer method to see the difference between the Server.Execute and Server.Transfer methods.
回过头来再看看Server.Transfer方法,你会发现,在“Server.Execute”和“Server.Transfer”方法之间存在着不同。