By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,454 Members | 3,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,454 IT Pros & Developers. It's quick & easy.

Refreshing a datagrid at predetermined intervals?

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <to*@nospam.com> wrote in message
news:ea**************@TK2MSFTNGP11.phx.gbl...
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

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.