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%>
Share the Post:
Share on facebook
Share on twitter
Share on linkedin


Recent Articles: