Simple ways to Auto Refresh Web Page? - AspNet

random

Simple ways to Auto Refresh Web Page? - AspNet

C# - Auto Refresh Web Page in WebApplication

In this post I will explain how to auto refresh web page? There are following simple ways to reload web page after some interval of time (Eg:- in 15 seconds).
  • You can simply add following line of code in between <head> </head> section to enable auto refresh in an Asp.Net web page or a HTML page.
<meta http-equiv="refresh" content="15"/>


C# - Auto Refresh Web Page in WebApplication

  •  You can also add follwoing line of code in between <head> </head> section to redirect to a specific page if you put the URL inside the tag.
<meta http-equiv="refresh" content="5;url=http://www.google.com" />

  •  If you want to set the refresh web page dynamically then that can be done in Asp.Net by adding server side code in the Page_Load function to set it, as shown below:
Response.AppendHeader("Refresh", "15");


Simple ways to Auto Refresh Web Page? - AspNet Reviewed by Ravi Kumar on 12:25 PM Rating: 5

No comments:

All Rights Reserved by Etechpulse © 2012 - 2017

Contact Form

Name

Email *

Message *

Powered by Blogger.