Invoke method after a regular time interval

  • Thread starter Thread starter Hemant
  • Start date Start date
H

Hemant

Hi,

I am working asp.net 2005 . I want to save my data into database after every
2 minutes till my application is running. For this I have to call save
method after every 2 min so please help to solve this.

Thanks ,
Hemant
 
Hemant said:
Hi,

I am working asp.net 2005 . I want to save my data into database after
every 2 minutes till my application is running. For this I have to call
save method after every 2 min so please help to solve this.

Thanks ,
Hemant
In an asp.net app, you realise the code runs on the server - right?

I can't think of any way to do that with javascript.
So I reckon you'd need to look at silverlight or activex.
I like silverlight..
 
I am working asp.net 2005 . I want to save my data into database after
every 2 minutes till my application is running. For this I have to call
save method after every 2 min so please help to solve this.

What "data" are you talking about?
 
Hemant said:
Hi,

I am working asp.net 2005 . I want to save my data into database after every
2 minutes till my application is running. For this I have to call save
method after every 2 min so please help to solve this.

You'll have to use Ajax and make a call to a function from client side
javascript to get to a method on the codebhind file.

<http://www.codeproject.com/KB/aspnet/CallCodeBehindByJS.aspx>

You set the timer and call the function. The function called will be
going back to the codebehind file to call the Save() method.

<http://www.howtocreate.co.uk/tutorials/javascript/timers>
<http://www.pageresource.com/jscript/jtimeout.htm>

I don't know if you can set the timer in millseconds for 5 minutes, let
me know.
 
Back
Top