วิธีการดำเนินการ ASP
❮ อ้างอิงวัตถุเซิร์ฟเวอร์ที่สมบูรณ์
วิธี Execute เรียกใช้งานไฟล์ ASP จากภายในไฟล์ ASP อื่น หลังจากเรียกใช้ไฟล์ .asp ที่เรียก ตัวควบคุมจะส่งคืนไปยังไฟล์ .asp ดั้งเดิม
ไวยากรณ์
Server.Execute(path)
Parameter | Description |
---|---|
path | Required. The location of the ASP file to execute |
ตัวอย่าง
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!
ดูที่วิธี Server.Transfer เพื่อดูความแตกต่างระหว่างวิธี Server.Execute และ Server.Transfer
❮ อ้างอิงวัตถุเซิร์ฟเวอร์ที่สมบูรณ์