PC Review


Reply
Thread Tools Rate Thread

Autorefresh a page after x seconds.

 
 
UJ
Guest
Posts: n/a
 
      11th Aug 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
 
      11th Aug 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
 
      11th Aug 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
 
Rick
Guest
Posts: n/a
 
      11th Aug 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
 
      12th Aug 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
Rate This Thread
Rate This Thread:

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
Autorefresh page at client =?Utf-8?B?RWR3YXJk?= Microsoft ASP .NET 7 29th Sep 2005 07:12 AM
IE6: autorefresh? =?Utf-8?B?TWVocmFu?= Windows XP Internet Explorer 9 7th Feb 2005 05:16 PM
Autorefresh quixote Microsoft Windows 2000 Registry 0 20th Jul 2004 09:17 PM
How to load temp page for a few seconds and then redirect to another page moondaddy Microsoft ASP .NET 1 30th Mar 2004 09:30 PM
Autorefresh on a ASP page Paul Microsoft Dot NET Framework 1 6th Nov 2003 10:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:45 AM.