Timers in application web programming

  • Thread starter Thread starter Stephen Inkpen
  • Start date Start date
S

Stephen Inkpen

I'm trying to get my page to automatically update a data table every
10 seconds but using the System.Timer object doesn't seem to work.

Anyone know how to get a web page to automatically get new data from
the server on a regular interval?

Thanks,

Stephen Inkpen
 
You need to output some regular HTML to force the open browser to refresh the
page:

<HTML>
<HEAD>
<META HTTP-EQUIV="refresh" content="2;URL=http://www.yoursite.com/newpage.htm">
<TITLE>Page has moved</TITLE>
</HEAD>
<BODY>
whatever you want to write
</BODY>
</HTML>


<META HTTP-EQUIV="refresh" CONTENT="n; URL=http://foo.bar/">

"This is a so-called "meta refresh", which on certain browsers causes the
document mentioned in the URL to be loaded after n seconds. This can be used
for slide shows or for often-changing information, but has some drawbacks. In
particular, if you use a value of zero seconds, the user can no longer go
"Back" with his back button. He will be transferred to the specified URL, and
when he presses "back" there, he will go back to the document with the refresh,
which immediately redirects him to the document he tried to get away from."


I'm trying to get my page to automatically update a data table every
10 seconds but using the System.Timer object doesn't seem to work.

Anyone know how to get a web page to automatically get new data from
the server on a regular interval?

Thanks,

Stephen Inkpen
 
Back
Top