Link to home
Create AccountLog in
Avatar of TelDig
TelDigFlag for Canada

asked on

ASP.NET manual start and stop timer

Hi,

I am using ASP.NET 1.1 without AJAX.
Programming in C#.

What I need to do in my ASP.NET page is:

When the user clicks on a button in the page, it starts a timer.
That timer will refresh the page every 10 seconds so that my datagrid binded to the database will be refreshed.
When all data is up to date, stop the timer programatically.

I need to know how to start a timer in ASP.NET, and how to stop it when required.
How do I do that?

Thanks a lot
Avatar of _Stilgar_
_Stilgar_
Flag of Israel image

Perhaps use a javascript timer (client-side scripting) initiated on page load (onload event), and when done loading just don't write that script anymore?
Avatar of TelDig

ASKER

OK,

I am not very good with JavaScript.
Could you give me an example of the JavaScript function?

Do I have to use setTimeout? And how do I refresh my page from JavaScript?

Thank you!
ASKER CERTIFIED SOLUTION
Avatar of _Stilgar_
_Stilgar_
Flag of Israel image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer