Mahdi_Nine
Mahdi_Nine

Reputation: 14751

auto refreshing page when data in database is changed

my page is using sqlcachedependency. so the page read information from cache until data in database is changed but i need the page was auto refresh when data is changed. How can i do that?

Upvotes: 1

Views: 1894

Answers (1)

Wouter de Kort
Wouter de Kort

Reputation: 39898

The problem you have is that the Server knows the data has changed but that there is no active communication with the client until the user hits a button in his browser.

A solution for this could be to write some javascript that would ask the server every X seconds if there are changes. If you want to implement something like this you need to look at AJAX and the Periodic Refresh pattern.

Or you could have a look at the new WebSockets that's being implemented in HTML5 which allows bidirectional communication between client and server.

Upvotes: 1

Related Questions