Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have deployed a website. there is a page that takes feeds from a website, this webpage doesn't do anything just take the feeds. these feeds are taken after each 2 seconds. how is it possible to rotate that page after every 2 seconds without opening it. m using asp.net with c#
Posted
Comments
Ankur\m/ 20-Jul-11 4:58am    
you mean the way tweets are displayed?
Rakesh From Patna 20-Jul-11 5:25am    
You use Ajax update panel and timer control.

1 solution

You don't need AJAX, a tiny bit of js will make the page refresh itself regularly.

<script>
<!--

//enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59
var limit="0:30"

if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.images)
return
if (parselimit==1)
window.location.reload()
else{
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
if (curmin!=0)
curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!"
else
curtime=cursec+" seconds left until page refresh!"
window.status=curtime
setTimeout("beginrefresh()",1000)
}
}

window.onload=beginrefresh
//-->
</script>

Of course, you can get rid of the stupid 'minutes to refresh' label.
 
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