Timer not working

  • Thread starter Thread starter Tony M
  • Start date Start date
T

Tony M

VB .net 2005 Web pages.

Just trying to delay before redirecting to another web site.

Don't know why this doesn't work? I don't get any errors just doesn't work.

Imports System.Timers
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Dim Tim As New Timer(10000)
AddHandler Tim.Elapsed, AddressOf GoBizSite
Tim.Interval = 10000
Tim.Enabled = True
Label1.Text = ("You will be rediected in 10 seconds")
End Sub
Sub GoBizSite(ByVal source As Object, ByVal e As ElapsedEventArgs)
Response.Redirect("http://www.xxxxxx.biz")
End Sub
End Class

Thanks
 
Tony M said:
VB .net 2005 Web pages.

Just trying to delay before redirecting to another web site.

Don't know why this doesn't work? I don't get any errors just doesn't work.

Imports System.Timers
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Dim Tim As New Timer(10000)
AddHandler Tim.Elapsed, AddressOf GoBizSite
Tim.Interval = 10000
Tim.Enabled = True
Label1.Text = ("You will be rediected in 10 seconds")
End Sub
Sub GoBizSite(ByVal source As Object, ByVal e As ElapsedEventArgs)
Response.Redirect("http://www.xxxxxx.biz")
End Sub
End Class

Thanks

The timer is probably working, but the page has already gone down to the
client.

You can get to what you want by including something like the following in
your page:

<meta http-equiv="refresh" content="10;URL=http://www.xxxxxx.biz" />

Mike
 
Back
Top