Refreshing a datagrid at predetermined intervals?

Discussion in 'ASP .Net' started by Tom, Nov 4, 2004.

  1. Tom

    Tom Guest

    I have an ASP.NET web page coded in VB.NET (2003). That web page has a
    dropdown box on it which is loaded during the page_load event. When the user
    drops this down and selects a data item, the code reads the database (based
    upon what they selected, of course) and then loads the appropriate data into
    the grid for display.

    Now, however, I need to have the grid 'refreshed' at certain intervals. For
    instance, if they leave the browser page alone, in 30 seconds (of
    inactivity) I want the screen to 'refresh' - but really just re-read the
    database (based upon the selected dropdown item) and repopulate the grid.

    I thought I could do this with a meta tag (<meta HTTP-EQUIV="Refresh"
    CONTENT="30;">); although this works (in that the screen does refresh) it is
    not a programmed refresh. In my case, the page_load is re-executed and it
    thinks it is NOT a postback so the screen is reset back to it's initial
    defaults (i.e. the grid is cleared, set to NOT visible, and the dropdown is
    reloaded and set back to it's non-selected default). What I need is some
    kind of programmed refresh; something like - after a set time it will cause
    an event to fire where I can see if the drop down value is the same and if
    so, then re-read the database and refresh the grid.

    There is no Timer in VB/ASP so I am not sure how to implement something like
    this, if it is even possible. Any ideas? I am sure someone has had this kind
    of need in the past.

    Thanks in advance.

    Tom
    Tom, Nov 4, 2004
    #1
    1. Advertising

  2. Tom

    Curt_C [MVP] Guest

    look at the JavaScript SetTimeout() and have it call a Form.Submit()
    It's a clientside thing, nothing to do with server-side programming.

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "Tom" <> wrote in message
    news:eappj$...
    >I have an ASP.NET web page coded in VB.NET (2003). That web page has a
    > dropdown box on it which is loaded during the page_load event. When the
    > user
    > drops this down and selects a data item, the code reads the database
    > (based
    > upon what they selected, of course) and then loads the appropriate data
    > into
    > the grid for display.
    >
    > Now, however, I need to have the grid 'refreshed' at certain intervals.
    > For
    > instance, if they leave the browser page alone, in 30 seconds (of
    > inactivity) I want the screen to 'refresh' - but really just re-read the
    > database (based upon the selected dropdown item) and repopulate the grid.
    >
    > I thought I could do this with a meta tag (<meta HTTP-EQUIV="Refresh"
    > CONTENT="30;">); although this works (in that the screen does refresh) it
    > is
    > not a programmed refresh. In my case, the page_load is re-executed and it
    > thinks it is NOT a postback so the screen is reset back to it's initial
    > defaults (i.e. the grid is cleared, set to NOT visible, and the dropdown
    > is
    > reloaded and set back to it's non-selected default). What I need is some
    > kind of programmed refresh; something like - after a set time it will
    > cause
    > an event to fire where I can see if the drop down value is the same and if
    > so, then re-read the database and refresh the grid.
    >
    > There is no Timer in VB/ASP so I am not sure how to implement something
    > like
    > this, if it is even possible. Any ideas? I am sure someone has had this
    > kind
    > of need in the past.
    >
    > Thanks in advance.
    >
    > Tom
    >
    >
    Curt_C [MVP], Nov 4, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    479
    sjulhes
    Nov 22, 2005
  2. =?Utf-8?B?am9l?=

    Updating IE Page at regular intervals

    =?Utf-8?B?am9l?=, Jan 21, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    340
    Steve C. Orr [MVP, MCSD]
    Jan 21, 2004
  3. =?Utf-8?B?RHVzdGluIElJLg==?=

    Cache objects on serverside and given intervals (timer?)

    =?Utf-8?B?RHVzdGluIElJLg==?=, Nov 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    351
    Karl Seguin
    Nov 23, 2004
  4. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    445
    =?Utf-8?B?Y2xpY2tvbg==?=
    Aug 4, 2006
  5. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 3, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    179
    Harlan Messinger
    Aug 3, 2006
Loading...

Share This Page