473,397 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Autorefresh a page after x seconds.

UJ
Could somebody post code to make a page reload itself after x seconds? I
know it needs to be done in Javascript just don't know how to do it.

TIA
Nov 19 '05 #1
5 1312
Put this in the <head>:

<META HTTP-EQUIV="Refresh" CONTENT="300">

Content is the number of seconds.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Could somebody post code to make a page reload itself after x seconds?
I know it needs to be done in Javascript just don't know how to do it.

TIA


Nov 19 '05 #2
<html>
<head>
<title>WebForm1</title>
<meta HTTP-EQUIV="Refresh" url="http://10.25.0.147" CONTENT="240">
</head>
<body></body>
</html>
Nov 19 '05 #3
UJ wrote:
Could somebody post code to make a page reload itself after x seconds? I
know it needs to be done in Javascript just don't know how to do it.

TIA


look at META REFRESH for this.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #4

In your page load event try this:

context.Response.AppendHeader("Refresh", "60") 'units are seconds

Or the Javascript way:

Dim sScript As String
sScript = "<script language='javascript'>"
sScript += "setInterval('location.reload();',"6000");" 'units are
milliseconds
sScript += "</script>"
If Not Page.IsClientScriptBlockRegistered("refreshscript" ) Then
Page.RegisterClientScriptBlock("refreshscript", sScript)
End If

"UJ" <fr**@nowhere.com> wrote in message
news:en**************@TK2MSFTNGP12.phx.gbl...
Could somebody post code to make a page reload itself after x seconds? I
know it needs to be done in Javascript just don't know how to do it.

TIA

Nov 19 '05 #5
UJ
Thanks everybody. I did get it to work using Javascript.
"Rick" <te**@test.com> wrote in message
news:ez**************@TK2MSFTNGP14.phx.gbl...

In your page load event try this:

context.Response.AppendHeader("Refresh", "60") 'units are seconds

Or the Javascript way:

Dim sScript As String
sScript = "<script language='javascript'>"
sScript += "setInterval('location.reload();',"6000");" 'units are
milliseconds
sScript += "</script>"
If Not Page.IsClientScriptBlockRegistered("refreshscript" ) Then
Page.RegisterClientScriptBlock("refreshscript", sScript)
End If

"UJ" <fr**@nowhere.com> wrote in message
news:en**************@TK2MSFTNGP12.phx.gbl...
Could somebody post code to make a page reload itself after x seconds? I
know it needs to be done in Javascript just don't know how to do it.

TIA


Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ariel | last post by:
Hi, I have this problem: In my intranet I use a hidden frame that autorefresh every 30 seconds. That page records a hit into SQL Server thats indicates to me the user still on-line. I use this:...
2
by: Just D | last post by:
Hi, I know how can I cache the ASPX page or any control on this page. But how can I refresh ASPX page automatically every xx seconds? Any script? I need my application to go to the server and...
4
by: vbGansta | last post by:
Hi there. I am using SmartNavigation="True" in one of my pages and it is working except for one instance. If I hit the browser refresh, or a button on my form smart nav works just fine. I also...
7
by: Edward | last post by:
How can I automatically send another page to the users webbrowser (preferable in c#)? So, somebody is looking at a webpage and after some processing at the server, I want to show this user another...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.