Tuesday, November 25, 2008

Auto Refresh to ASP.NET Page

There are several methods, including Java Script. But, after searching the web for several minutes without finding an easy solution, my partner, Bill Ryan told me how to do this simple trick. It was only complicated by the fact that I have other controls on the page beside the DataGrid.

To simply refresh the web page every five minutes, you can place the
"meta http-equiv...." line shown below in the HTML editor of your ASPX page. Content ="300" means refresh every 300 seconds or five minutes.

<HEAD>
<title>WebForm1title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
--The next line of code will refresh the page every 5 minutes-->
<meta http-equiv="refresh" content="300">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
HEAD>

No comments: