Timer not working


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
 
Ad

Advertisements

F

Family Tree Mike

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Getting a timer to work 11
Me.InvokeRequired 4
Cross thread (VB.NET 2005) 7
Dual Serial Ports 3
Timer question 2
Add timers to an array of objects 2
Passing values between webpages 1
Workflow problem 2

Top