Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Refreshing a datagrid at predetermined intervals?

Reply
Thread Tools

Refreshing a datagrid at predetermined intervals?

 
 
Tom
Guest
Posts: n/a
 
      11-04-2004
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


 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      11-04-2004
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" <(E-Mail Removed)> wrote in message
news:eappj$(E-Mail Removed)...
>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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Self-refreshing and non-self-refreshing controls Harlan Messinger ASP .Net 1 08-04-2006 01:13 PM
Self-refreshing and non-self-refreshing controls Harlan Messinger ASP .Net Web Controls 0 08-03-2006 12:29 PM
How to store a predetermined value in memory. dhbrewer@gmail.com VHDL 3 11-22-2005 07:16 AM
Refreshing a DataGrid that is bound to a Collection of Business Objects =?Utf-8?B?S2VsbHkgUw==?= ASP .Net 1 05-19-2004 08:21 PM
Refreshing DataGrid in page_load A.M ASP .Net 7 11-04-2003 02:27 PM



Advertisments