swodder
June 18th, 2002, 12:43 PM
Hello,
I wish to use a timer to perform some operations at fixed intevals. I have read the help on it and it seems quite easy to understand using the Timer class. However my problem is where does the code go?
I am writing an ASP.NET application. I tried updating the Global.asax.cs file ie.
private Timer timer1;
protected void Application_Start(Object sender, EventArgs e)
{
timer1 = new Timer();
timer1.Enabled = true;
timer1.Interval = 60000;
timer1.AutoReset = true;
timer1.Elapsed += new ElapsedEventHandler(Timer1_Elapsed);
}
but the Timer1_Elapsed method is never called.
Could somebody please point me in the correct directions
Thanks,
John.
I wish to use a timer to perform some operations at fixed intevals. I have read the help on it and it seems quite easy to understand using the Timer class. However my problem is where does the code go?
I am writing an ASP.NET application. I tried updating the Global.asax.cs file ie.
private Timer timer1;
protected void Application_Start(Object sender, EventArgs e)
{
timer1 = new Timer();
timer1.Enabled = true;
timer1.Interval = 60000;
timer1.AutoReset = true;
timer1.Elapsed += new ElapsedEventHandler(Timer1_Elapsed);
}
but the Timer1_Elapsed method is never called.
Could somebody please point me in the correct directions
Thanks,
John.