SQL PHP HTML ASP JavaScript articles and free scripts to download

Server Transfer to run another ASP file

This is one way transfer of script execution from main file to another file without returning to main file again. ( Returning to main file again happens in Server.Execute method ). You can also read how Response.Redirect works similar to server.tranfer. Here is the code for file1.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 file1.asp file "
Response.Write " <br>---<br> "
Server.Transfer("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 file1.asp file we will get the output like this

I am inside file1.asp file
---
I am in file2.asp inside

Here the main difference between server.execute and server.transfer is in case of server transfer the control does not return to main file again. In case of server.execute the script control returns to main file after executing the inner ( or file2.asp) file.
Google+

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
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2014 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer