Avatar of TelDig
TelDig
Flag 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
ASP.NETWeb Applications

Avatar of undefined
Last Comment
_Stilgar_

8/22/2022 - Mon
_Stilgar_

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?
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
_Stilgar_

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy