Refreshing a datagrid at predetermined intervals?

T

Tom

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
 
C

Curt_C [MVP]

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top