Autorefresh in time interval
-
Hi everyone, My page need to be automatically refresh in every 20 minutes and get the data from table and show it. This I did simply. The time is calculate from when I load my page (i.e) If I load my page at 10:25 AM then it automatically refresh at 10:45AM, but my actual requirement is It should load every 20 minutes from 10:00AM to 8:00PM in that time interval....(i.e) If I load the page at 10:25AM then it automatically refresh at 10:40AM then next 11:00AM, 11:20AM, 11:40AM.................7:40PM, 8:00PM and it stop. How can I achieve this in my C# code or Javascript? Give me some idea pl. Thanks
-
Hi everyone, My page need to be automatically refresh in every 20 minutes and get the data from table and show it. This I did simply. The time is calculate from when I load my page (i.e) If I load my page at 10:25 AM then it automatically refresh at 10:45AM, but my actual requirement is It should load every 20 minutes from 10:00AM to 8:00PM in that time interval....(i.e) If I load the page at 10:25AM then it automatically refresh at 10:40AM then next 11:00AM, 11:20AM, 11:40AM.................7:40PM, 8:00PM and it stop. How can I achieve this in my C# code or Javascript? Give me some idea pl. Thanks
You can implement Time control using AJAX. Refer http://ajax.net-tutorials.com/controls/timer-control/[^] Hope this helps. All the best.
-
Hi everyone, My page need to be automatically refresh in every 20 minutes and get the data from table and show it. This I did simply. The time is calculate from when I load my page (i.e) If I load my page at 10:25 AM then it automatically refresh at 10:45AM, but my actual requirement is It should load every 20 minutes from 10:00AM to 8:00PM in that time interval....(i.e) If I load the page at 10:25AM then it automatically refresh at 10:40AM then next 11:00AM, 11:20AM, 11:40AM.................7:40PM, 8:00PM and it stop. How can I achieve this in my C# code or Javascript? Give me some idea pl. Thanks
Add
Async="true"
to the Page directive, like so:
<%@ Page Async="true" Language="C#" AutoEventWireup="true" CodeFile="ProviderAlerts.aspx.cs" Inherits="ProviderAlerts" %>
Then, add this javascript:
<script type="text/javascript"> <!-- Begin function reFresh() { location.reload(true) } /\* Set the number below to the amount of delay, in milliseconds, you want between page reloads: 1 minute = 60000 milliseconds. \*/ window.setInterval("reFresh()",300000); // End --> </script>
This reloads the page every five minutes.
My other signature is witty and insightful.