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
 
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


Top