Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Autorefresh in time interval

Autorefresh in time interval

Scheduled Pinned Locked Moved ASP.NET
questioncsharpjavascript
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    prakulsol
    wrote on last edited by
    #1

    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

    P G 2 Replies Last reply
    0
    • P prakulsol

      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

      P Offline
      P Offline
      Pravin Patil Mumbai
      wrote on last edited by
      #2

      You can implement Time control using AJAX. Refer http://ajax.net-tutorials.com/controls/timer-control/[^] Hope this helps. All the best.

      1 Reply Last reply
      0
      • P prakulsol

        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

        G Offline
        G Offline
        goodideadave
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups