Resources » .NET programming » ASP.NET/Web Applications

How to automatically refresh a web page ?


Posted Date: 04-Apr-2004  Last Updated:   Category: ASP.NET/Web Applications    
Author: Member Level: Gold    Points: 10


This short article shows couple of ways you can refresh your web page after some specific time. It talks about the META tag and an ASP.Net way of doing the same.



There are couple of different ways you can automatically refresh a webpage. See few different approaches below:

METHOD 1

Using the standard HTML Mewta tag 'Refresh'. This tag specifies a delay before the browser
automatically reloads the page. The delay is specified in seconds. You can specify a URL also to reload. If you do not specify a URL, it will relaod the same page after the interval.

<META HTTP-EQUIV="Refresh" CONTENT="10;URL=http://www.dotnetspider.com";>


The above META tag tells the browser to reload the current page after 10 SECONDS. SO, if you have the above meta tag in your page, 10 seconds after it is loaded, it will reload the page - but the URL specified is http://www.dotnetspider.com. So, after 10 seconds, your page will be replaced with http://www.dotnetspider.com.

Note that the META tags should be placed in the head portion of the HTML document, between the <HEAD> and </HEAD> tags.

METHOD 2

This is the ASP.Net way !

Response.AppendHeader("Refresh", "10; URL=http://www.dotnetspider.com")


Did you like this resource? Share it with your friends and show your love!

Responses to "How to automatically refresh a web page ?"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Submit Article     Return to Article Index

    Subscribe to Subscribers
    Active Members
    Today
      Last 7 Daysmore...

      Awards & Gifts
      Talk to Webmaster Tony John

      Online Members

      John Bhatt
      More...
      Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India