auto refreshing page when data in database is changed

1.8k views Asked by At

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?

1

There are 1 answers

2
Wouter de Kort On BEST ANSWER

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.