ASP Execute Method
xecute method performs ASP file from another ASP file. After finished .asp file is called, control will return to the original .asp files.
grammar
Server.Execute(path)
参数 | 描述 |
---|---|
path | 必需。要执行的 ASP 文件的位置。 |
Examples
File1.asp:
<%
response.write("I am in File 1!<br>")
Server.Execute("file2.html")
response.write("I am back in File 1!")
%>
File2.asp:
<%
response.write("I am in File 2!<br>")
%>
输出:
I am in File 1!
I am in File 2!
I am back in File 1!
<%
response.write("I am in File 1!<br>")
Server.Execute("file2.html")
response.write("I am back in File 1!")
%>
File2.asp:
<%
response.write("I am in File 2!<br>")
%>
输出:
I am in File 1!
I am in File 2!
I am back in File 1!
See Server.Transfer method to learn about the difference between Server.Execute and Server.Transfer methods.
Complete Server Object Reference