Autorefresh a page after x seconds.

  • Thread starter Thread starter UJ
  • Start date Start date
U

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
 
UJ said:
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top