Latest web development tutorials

ASP ดำเนินการวิธีการ

อ้างอิงวัตถุเซิร์ฟเวอร์ อ้างอิงวัตถุสมบูรณ์เซิร์ฟเวอร์

วิธีการดำเนินการ xecute ASP ไฟล์จากไฟล์ ASP อื่น หลังจากที่แฟ้ม .asp สำเร็จรูปที่เรียกว่าการควบคุมจะกลับไปยังไฟล์ .asp เดิม

ไวยากรณ์

Server.Execute(path)

参数 描述
path 必需。要执行的 ASP 文件的位置。

ตัวอย่าง

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!

ดูวิธีการ Server.Transfer เรียนรู้เกี่ยวกับความแตกต่างระหว่าง Server.Execute และ Server.Transfer วิธีการ


อ้างอิงวัตถุเซิร์ฟเวอร์ อ้างอิงวัตถุสมบูรณ์เซิร์ฟเวอร์