Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Autorefresh a page after x seconds.

Reply
Thread Tools

Autorefresh a page after x seconds.

 
 
UJ
Guest
Posts: n/a
 
      08-11-2005
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


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      08-11-2005
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
>




 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      08-11-2005
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
 
Reply With Quote
 
=?Utf-8?B?TWFoaQ==?=
Guest
Posts: n/a
 
      08-11-2005
<html>
<head>
<title>WebForm1</title>
<meta HTTP-EQUIV="Refresh" url="http://10.25.0.147" CONTENT="240">
</head>
<body></body>
</html>
 
Reply With Quote
 
Rick
Guest
Posts: n/a
 
      08-11-2005

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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
UJ
Guest
Posts: n/a
 
      08-12-2005
Thanks everybody. I did get it to work using Javascript.


"Rick" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Refreshing page 1 after page 2 has been called from page 1 patrice.fiset@gmail.com Javascript 2 06-20-2007 10:13 PM
autorefresh panel on web form =?Utf-8?B?VG9t?= ASP .Net 1 02-28-2007 09:10 PM
Autorefresh page at client =?Utf-8?B?RWR3YXJk?= ASP .Net 6 09-29-2005 06:12 AM
Smart Nav and AutoRefresh Problem vbGansta ASP .Net 4 04-27-2004 09:40 PM
Autorefresh ASP page help!! Ariel ASP General 2 02-27-2004 01:08 PM



Advertisments