Developing Web Applications

Previous Topic Next Topic

Redirecting During Session_OnStart

Redirection during the Session_OnStart event is possible, and sometimes required by your application (see the sidebar Web Clusters and ASP Session State). Here is an example:

Sub Session_OnStart
   Response.Redirect "MyStartPage.asp"
End Sub

Not all of the Response object’s methods are available during the Session_OnStart event. Most notably, you cannot use the Write method to display messages, since the client would never see them. However, you can redirect to an error message, if your application cannot successfully initialize a new user session.


© 1997-1999 Microsoft Corporation. All rights reserved.