<%
If Session("isLogin")="" Then
Response.Redirect "Login.asp"< BR>End If
'Normal content
%>
So, in fact, the Response.Redirect method returns an Http Header status to the browser. 302 tag code,
HTTP 1.0 302 Object Moved
Location URL
This is actually the browser requesting the server's content.asp file, the content.asp file is processed after processing Browser, you first access the login.asp file, so the browser sends a request to the login.asp page to the server. So, actually, it turned a corner. In this way, when the client network is not in good condition, the two requests will greatly reduce the response speed of the application and even occupy the excess bandwidth. In particular, there are some problems when you need to pass parameters.
In IIS5, the Server.Transfer and Server.Execute methods are provided.
The two methods are all done between the servers, so the network bandwidth of the client can be reduced, but because the server side saves some state of the program 1, it also consumes a certain amount of memory.
//This article comes from the computer software and hardware application network www.45it.com reproduced please specify
So what is the difference between Server.Transfer and Server.Execute?
By example, there are two files, file1.asp and file2.asp
We are all going to file2.asp inside file1.asp
When using the Tansfer method:
file1.asp
<%
Response.Write "File 1 Header<br>"
Server.Transfer "file2.asp"
' stops here and executes the following statement, turning to
Response.Write "File 1 Footer<br>"
%>
file2.asp
<%
Response.Write "小雨在线"
%>
All, when we execute the file1.asp file, The result we get is
File 1 Header
小雨在线
Because, when the program encounters the Transfer method, it will stop executing the following statement, and then execute the program that turns to
>
When using the Execute method:
file1.asp
<%
Response.Write "File 1 Header<br>"
Server.Execute "file2.asp"
'Execute file2.asp here, continue to execute the rest after completion
Response.Write "File 1 Footer<br>"
%>
file2.asp
<%
Re sponse.Write "File 2"
%>
All, when we execute the file1.asp file, we get the result
File 1 Header
File2
File 1 Footer
Because, when the program encounters the Execute method, it will execute the redirected program, and then continue to execute the rest of the first page.
In fact, the Execute method is just like the subroutine we often write, similar to the subroutine call.
as shown below:
At present, there are more and more schools using Windows 2003 as a web server. However, for users w
The security software installed on the computer is still no problem for general SQ
Server virtualization is in full swing and unstoppable. There are also many legend
Test Topology: Test Content and Topology Description: Test Content: Independent Root CA Server and I
IIS 7 directory permissions settings detailed questions
RAID technology key knowledge and RAID features
Experience: How to be a server administrator?
How to know who is switching process in Linux
Evaluate backup needs Virtualization Server New Policy
Windows Server 2008 Server Status Backup\\Restore Raiders
Linux server from entry to proficient 52 questions
How does the Win8 process System.exe disk take up 100%?
Win8 system to modify the computer name in order to identify tips
Quickly transfer Foxmail address book
Computer virtual memory is too low, how to do virtual memory is insufficient to solve
Easy to repair Win8 on the network with 360 security guards
Win7 calculators are more than just adding, subtracting, multiplying and dividing
Win7 library to help you quickly find files (1)
Microsoft acquires 3D motion recognition developer for Windows 8