Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

UpdatePanel with Timer, enabled based on database value

$
0
0

Hi,

I have an UpdatePanel on each of my content pages. I want to add some form of timer control that can be enabled/disabled by getting the (boolean) value from the database on page load, as well as dynamically updating its Enabled/Disabled state with jQuery.

So the process would be:

full page load get true | false value from db for timer
if enabled run every x seconds, if disabled do nothing
somebody presses the Timer button that toggles the state in the database, and changes the state of the timer without a full page load/postback
if that change is to Enabled begin the timer, if that change is to Disabled stop the timer, both without a full page load/postback

If I use ASP.NET's Timer control, I can do the first part easily by populating the Enabled property with the value from the database. But, can client-side code dynamically change its state?

I am already doing 'manual' jQuery UpdatePanel postbacks elsewhere using this, so I wonder if a custom jQuery timer would be better:

page._doPostBack( 'ctl00$header$Search_Button', '' );

But can I enable/disable such a timer dynamically as well, and on page load?

Open to suggestions.

Thanks


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>