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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top