Click here to Skip to main content
15,898,374 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
Hi,
I have web page there I have a data list that should be bind at every minutes interval.

Please give the correct way to do this.

Thanx
Seema
Posted

One of the ways i can think of right now is... using Javascript for it.
You would need to use setInterval and UpdatePanel/PageMethod/CallBack.

For setInterval that fires after the specified delay, and keeps firing again after the same delay, until it is cancelled.:
http://www.howtocreate.co.uk/tutorials/javascript/timers[^]

you can pick any one of the AJAX methods here. Based on the setInterval function in your page, you can re-bind datalist again and again.
For example if you choose Update Panel: Have a dummy button inside panel along with datalist. Fire the button click in the setInterval javascript function. Update panel get partial refresh
 
Share this answer
 
v2
Use a Timer Control[^].
On the Timer_Tick event, write the code to get the fresh data from database and bind it.

Hope this helps!
 
Share this answer
 
function Update()
{
setTimeout("__doPostBack('CountrolID','')","TimeDelayInMilliseconds");
}
</script>
 
Share this answer
 
as Sandeep explains setInterval acts like a Tiner in javascript,
AJAX is the way that you can call Codebehind function using Javascript.

This may help you

regards
koolprasad2003 :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900