473,503 Members | 2,150 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using timer with asp.net Web application

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
May 7 '06 #1
1 1397
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.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Dan Kimhi" <da*@sof.fr> wrote in message
news:OK**************@TK2MSFTNGP04.phx.gbl...
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

May 7 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2475
by: ray | last post by:
Hi, I just wrote a windows service application to call a function of another object periodically. I used System.Server.Timer and I found that it works fine within the first 2 hours but the...
6
17140
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
2
3511
by: Amit Dedhia | last post by:
Hi I am developing a scientific application which has moderate level image processing involved. In my application, there is a main application form which invokes another form. When this form...
2
4562
by: Amit Dedhia | last post by:
Hi I am developing a scientific application which has moderate level image processing involved. In my application, there is a main application form which invokes another form. When this form...
2
673
by: Amit Dedhia | last post by:
Hi I am developing a scientific application which has moderate level image processing involved. In my application, there is a main application form which invokes another form. When this form...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5594
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5022
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.