home *** CD-ROM | disk | FTP | other *** search
- ' this page is just an example of how you can create a generic
- ' redirection scheme in your application. If you pass a URL to the
- ' query string for this page, execution will jump to that page, but
- ' you have the opportunity to update your counters and other stats.
-
- Public Class RedirectPage
- Inherits System.Web.UI.Page
-
- #Region " Web Form Designer Generated Code "
-
- 'This call is required by the Web Form Designer.
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
-
- End Sub
-
- Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
- 'CODEGEN: This method call is required by the Web Form Designer
- 'Do not modify it using the code editor.
- InitializeComponent()
- End Sub
-
- #End Region
-
- Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- ' Read the targer URL on the query string.
- Dim url As String = Request.QueryString("url")
-
- ' increment the number of redirections so far.
- Dim appVarName As String = "redirections_count"
- Application.Lock()
- If Application(appVarName) Is Nothing Then
- Application(appVarName) = 1
- Else
- Application(appVarName) = CInt(Application(appVarName)) + 1
- End If
- Application.UnLock()
-
- ' redirect to the specified URL (must be on this web server).
- Server.Transfer(url)
- End Sub
-
- End Class
-