Download
Academy
Current location: Downcodes.com -> Academy -> Programming -> ASP tutorial -> Making your page auto-refresh
Recommend
HOT TOP10
Making your page auto-refresh
Date: 2008-1-4 Author: Hit: View:[Large font Middle font Small font]
Here is a simple screen auto-refresh technique. Use the HTML META tag like this:

<META http-equiv="refresh" content="5;URL="Mypage.asp">

The '5' is the delay time in seconds before opening the URL. The URL is the page you wish to open after the delay. If you redirect the page back to itself it will continue to auto-refresh every 5 seconds. To further enhance the effect, a random time can be applied. To get the random time, insert the following code before the META tag.

<%
' Get Random delay time
Randomize
DELAY_TIME= Int(Rnd * 90) + 1
' Set a minimum duration
If DELAY_TIME < 30 then
DELAY_TIME= DELAY_TIME + 30
End if
%>

and change the META tag to be as follows:

<META http-equiv="refresh" content="<%=DELAY_TIME%>;URL=Mypage.asp">

The random time produced from the script will fall between 30 and 90 seconds. Unless the page is redirected to itself, the META tag should be the last line of code on the page.
 

(From: aspkey)

Relative article:
Relative software: