Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Web
Expertise: Intermediate
Jan 12, 2000

Redirect More Efficiently in IIS 5

If you are using Internet Information Server version 5, you can redirect browsers to a new page more efficiently. In IIS 4, you had to use Response.Redirect as in this snippet:

 
<%
 If Session("loggedin") = "" Then
   Response.Redirect "login.asp" 
 End If
%>

However, IIS 5 offers the Server object's new Transfer method. Server.Transfer is faster because it doesn't have to send the browser the new URL. It just transfers the user without leaving the server's request queue. Here's how the new feature looks in code:

 
<%
  If Session("loggedin") = "" Then
    Server.Transfer("login.asp")
  End if
%>
Ken Cox
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date