简体   繁体   中英

auto partial page refresh in asp.net without UpdatePanel

I want to make auto partial page refresh in asp.net. There is UpdatePanel but it sends too much data. So I've found that I can make a webservice and call it by the JavaScript code. But I don't know how to call webservice automatic. There are many examples showing how to call webservice by the button click event:

http://www.asp.net/ajax/videos/how-do-i-make-client-side-network-callbacks-with-aspnet-ajax

How to do this by the interval? Am I going in good direction?

Just use the setInterval function:

window.setInterval(function() {
    // code here will be called every 10 seconds
}, 10000);

To reset automatic calls you could use the clearInterval function on the id returned by the setInterval .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM