Reputation: 2297
I am working on .net application using C#. (Web)
I am having timer on my page, which runs at every 5 seconds. and it is doing a lot of operation in 5 sec or more(sometimes)
I have Button on the page, which opens some graph on click of that.
I want to abort the timer event in middle (i.e. lets assume my timer is running and it is in the middle of its operation, now my button is click which cause post back but that should be done intermediately, it should not wait for the timer to complete and then post back the page.)
Is there any way that i can stop the timer event in between and do my operation in C#.net ???
Upvotes: 3
Views: 1752
Reputation: 263147
From the client side, you can use $find() to get a reference to your timer object, then set its enabled
property to false
:
var timer = $find("yourTimerClientID");
timer.set_enabled(false);
Upvotes: 1