i once wrote a e-mail system that i wanted to be a-synchronous
i.o.w. i did not want the aspx page to wait untill the e-mail was generated
and send ( inmediate response back to the user )
what i did was the folowing
i added a standard module , declared a public class with properties and a
method sendmail
my aspx page received the parameters from the web , i passed these
parameters to the class module ( the parameters were e-mail adress to send
to , the message etc etc etc )
at last i called the method sendmail wich started a timer with delay of 500
miliseconds , when the timer triggered it would generate and send the e-mail
this did the trick for me ,,,,
what i wanted to say with this story is that it sure is possible to use a
timer in ASP.NET pages however they should be called from global code
M. Posseth [MCP]
"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Do you define the timer in an aspx page? That will NOT work as the
lifetime of that page (class) is one request. The next request will use a fresh
class where the timer will be reset. So the timer never fires!
It IS possible to use a timer, but (for asp.net) only in Global.asax.
What are you trying to do with this timer? Why are you using it?
yes in aspx page. when timer fires it should call webservice which
accesses a database and returns a dataset which contains information about alarms. i'll need to get that data from webservice about
every 10seconds
Then that's the problem. The aspx page is finished in milliseconds so the
timer gets destroyed long before it can fire.
Possibly you can change the timer to client-side, using a <meta
http-equiv=refresh content=10> tag in the html to refresh the page every 10 seconds. In the page get the data immediately to
build html to send back to the browser.
Hans Kesting