Persistent Web Application

  • Thread starter Thread starter Patrick Delifer
  • Start date Start date
P

Patrick Delifer

HI,
Can anyone tell me where I could find info/examples about this:
I have a Web page where a user enters info in fields and writes to a dB.
The result is displayed in a datagrid. However, I would like the
datagrid state to be persistent with the DB..I.e if another user updates
the datagrid, I want the datagrid to be updated automatically..
Now I know HTTP is stateless and I would have to go into Sockets,
Client/Server architecture? How do I go about this?
What's the best way of doing this? any help is appreciated..

Thanks

Patrick
 
Have you tried the HttpApplicationState object?

Application.Add(myDataGrid);

Just get it from the Application object whenever a user needs it.

This object is saved as long as IIS is running.

//Philip
 
Hi Philip.
No I hane't tried the HttpApplicationState Object. In fact I don't
really see how it could help in this context. I think I wasn't very
clear when describing the problem (as usual) :)

Let's say I have a web page (.aspx) divided in 2:
The top portion is an Order entry and the Bottom part is a Datagrid
which displayes the orders.

When the user creates an Order, the datagrid is automatically refreshed
with the new order.(using dataBind event). This works great.

The problem is, when or if an order is created somehwere else (another
user). I want to be able to refresh my datagrid (or refetch a DataBind)
using a time lapse (20 sec for example)..So that users should see the
new orders created without submitting a request to the server by
clicking a button...

I tried using a <META refresh HTML tag, but the problem is that when
users are entering data, they loose everything when the refresh is
executed and have to start reentering
the data..

Now my options are:
1. to refresh only the datagrid part of my page..(but how? using a
JavaScript?)
2. Use Frames? (Top for entry and Bottom for datagrid?) but how would I
send a button command to execute a databind on the Bottom frame page?
3. How would the HttpApplicationState object help in this context? or
would it?

thnaks for any help
 
the application method is still a good approach as suggested by Philip. But
you would need to add a global timer to your global asax file. On the timer
event, your code would be responsible for updating the cache data with the
current data.
 
Thanks, I will give it a try with the Global.asax..But can you give me a
bit more info on how to go about it? I tried to find some info on the
internet where they talk about adding an Object tag (I guess I would add
the object tag in my aspx code before the DataGrid)?

Then I would add the Application.Add in my global.asax?

THxn
 
Patrick,
Heres what I've done in the past. Heres the general idea... You'd
devide your page into frames (appropriately) and have one of them as a
hidden frame. On this frame you'd load the page with the datagrid (with
the contents in an identifiable span/div tag. In the visible frame you
could have some form of an indicator to suggest a change in the datagrid
(if any), the entry form and a span/div tag for copying the contents
from the hidden frame in case of change. Ideally in a web scenario the
users need take a voluntary action to refresh the contents, but you can
choose to make it automatic, so that every time the indicator is on
you'd replace the contents of the datagrid.
Hope I managed to get the idea accross.
Thanks
 
Back
Top