Update web page when database changes

C

cguillot

Hello,

I have a web page that displays information from a SQL database and
this information can change frequently. Basically, a database entry is
made into a table every time a person enters or leaves a defined area
and I need to display this information to a user watching a monitor.
Automatically refreshing the page is not a good option because it would
have to refresh no more than every 5 seconds and the screen flashes are
annoying. I have set up a Cache Dependency for the table and it
creates a file on the server every time there is a change in the table.
I then have a function that compares the last accessed time of the
file so I know when a change has occurred and can then refresh the
page.

How do I get the function to continuously check the file to see if a
change occurred once the page is loaded? Is there a better way to
refresh the data on my page without doing a refresh every few seconds?

Thanks,

Chad
 
S

Steve C. Orr [MVP, MCSD]

Assuming you must have a thin client (no .NET framework on the client) then
the web page must make a request to the server every N seconds to see if
there are any updates. The server cannot contact the client to let it know
about changes.
Since you don't like the screen flashing during the refresh every 5 seconds,
you could use SmartNavigation or some kind of AJAX / XMLHttp / Web Service
solution to have the page make a callback without refreshing the entire
page.

Here's more info:
http://msdn.microsoft.com/library/d...fSystemWebUIPageClassSmartNavigationTopic.asp
http://www.codeguru.com/Csharp/.NET/net_general/tipstricks/article.php/c9679/

This kind of thing gets easier in ASP.NET 2.0 if you can wait until then:
http://www.developer.com/net/asp/article.php/3506896
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,263
Messages
2,571,061
Members
48,769
Latest member
Clifft

Latest Threads

Top