How to auto refresh the ASP.NET form?

G

Guest

I do not have the experience with it. For example, update the data in the ASP
form every minute by retrieving data from database. Or do you have other
methods?

Thank you for any advice and information about it.

David
 
P

Patrice

What is the whole picture ?

This is mostly done with a meta tag that allows to trigger the page refresh.
Depending on what you are trying to do you may have also to do this
programmatically so that you can check for user input to avoid refreshing
while the user does something else (basically using setTimeout for
example)...
 
G

Guest

Hi David,

There are 2 aspects to this task:
1- The browser display being refreshed every fixed interval: As Patrice
responded in an earlier post, you achieve this using a meta tag in the aspx
markup. For example to cause the browser to refresh the page every 2 minutes:
<META HTTP-EQUIV="REFRESH" CONTENT=120>

2- The dataset:

a. For example, if you have a dataset of the navigational
menu entries for a website, you can retrieve it once, save it in the
application cache (to be used by every visitor of the site) and only refresh
the cache if the database entries have been updated. In ASP.NET 1.01 you
might use the CacheDependency, e.g.:
'assuming that a change in the database would save a control file on the
webserver
'start tracking any change to the control file
Dim MenuControlFile As New System.Web.Caching.CacheDependency("Control.txt",
Now())
'save your menu items dataset in the cache to be retrieved whenever needed
in the applicaion
'by writing: DataSet myDataSet = Ctype(Cache("MyMenu"), DataSet)
Cache.Insert("MyMenu", ds, MenuControlFile)

b. If you are using ASP.NET 2.0 with SQL server 2005 then
you might consider the “Sql Server 2005 Notification-based Cache Invalidationâ€
http://66.129.71.130/QuickStartv20/aspnet/doc/caching/SQLInvalidation.aspx
 
G

Guest

Thank both of you.

My example is a chekout list of patients, or a process list of procesures.
So each role player can view her/his list to process the role's job and give
the input to other role's job list which will be done by others based on the
list of items, and so on.

Each role list would be auto refreshed in a certain interval.

I will try it based on your advice.

David
 

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

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top