Using timer with asp.net Web application

D

Dan Kimhi

I'm unable to get the timer to fire the tick event. I use the following
code:

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
Timer1.Interval = 1 * 60 * 1000
Timer1.Start()
End Sub

Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Application.Lock()

{do something}

Application.UnLock()
End Sub

Doesn't execute "do something"....

Please help!

Thanks,


Dan Kimhi
 
S

Steve C. Orr [MVP, MCSD]

Threads come and go so quickly in ASP.NET that timers aren't generally of
much use.
Depending on what you're trying to do exactly, a Windows Service may be a
better choice.
 

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

Top