Reputation: 3
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?
Upvotes: 0
Views: 1743
Reputation: 1038810
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
.
Upvotes: 1