As a client-side solution, you can use the JavaScript setInterval()
function, like this:
var ResInterval = window.setInterval('myAjaxCall()', 15000); // 15 seconds
var myAjaxCall = function() {
$.ajax({
type: "GET",
url: 'YourPage.aspx/MyMethod',
dataType: "json",
success: function(xml) {
// Put logic here when data comes back from server
}
};
Note: The url
can be whatever is script callable (web service, WCF
service, ASP.NET AJAX Page Method
, etc.).
To stop the interval, do this:
window.clearInterval(resInterval);