SQL PHP HTML ASP JavaScript articles and free scripts to download
 

Server Execute to run another asp file

While running one .asp page we can transfer the script execution to another page by using server.execute command. For our example we will use two files. One is main.asp and other one is file2.asp. Here is the code for main.asp file.

<html><head>
<title>(Type a title for your page here)</title>
</head>
<body >

<%
Dim var1
var1=" My name is plus2net "
Response.Write " I am inside main.asp file "
Response.Write " <br>---<br> "
Server.Execute("file2.asp")
Response.Write " <br>---<br> "
Response.Write " I am back in main.asp file " & var1
%>

</body>
</html>

Now here is the code for file2.asp file

<%
Response.Write " I am in file2.asp inside "
%>

Once we run main.asp file we will get the output like this

I am inside main.asp file
---
I am in file2.asp inside
---
I am back in main.asp file My name is plus2net

You can see the control has shifted to file2.asp file but after its execution again it returned to main.asp page. This is the main difference between server.execute and server. transfer command in ASP


Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked

Join Our Email List
Email:  
For Email Newsletters you can trust
Server Object