[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Robin Prosch via .NET 247

6/5/2004 9:31:00 PM

Hi,

I have a senario where I want to cause a postback on a web page when a specific database value changes. I have thought about using a webservice that periodically checks the database value and sends a response to the page when the value changes.

Any thoughts on this subject would be greatly welcomed.

--------------------------------
From: Glynn Brown

-----------------------
Posted by a user from .NET 247 (http://www.dotn...)

<Id>Hseo0VDXH0iifxsEg7VYDQ==</Id>
1 Answer

Dino Chiesa [Microsoft]

6/8/2004 3:25:00 AM

0

The basic web browser (HTTP) model is request/reply: the browser requests a
page and the web app server (ASPX, or whatever) delivers a page, possibly a
dynamically generated page. Now the browser displays the page it has
received.

In your scenario, at this point, there is a value in a database somewhere
that has changed. The way to get the web page to be updated is for the
browser to re-request the page. That's the web model. The server cannot
tell the browser anything unless the browser asks for it. The conclusion
is, you need your browser (or some script or intelligence within it) to
inquire, or otherwise be aware of the change in the database.

How can you do this? One way to do it is to periodically poll. In other
words, the web page can just re-post itself every 1 minute or so. This
isn't very elegant, but maybe will do the job. Another way is to poll from
script code (running in the browser!), and maintain state in the browser,
without updating the entire page. For example you could maintain it in an
XML Data island, or similar. If the script determines that the value has
been updated, then you need to re-post the entire page.

The web service doesn't come into play unless the script in the browser is
actually invoking a webservice, or something like that.

-D


"Glynn Brown via .NET 247" <anonymous@dotnet247.com> wrote in message
news:uQp7CPzSEHA.2944@tk2msftngp13.phx.gbl...
> Hi,
>
> I have a senario where I want to cause a postback on a web page when a
specific database value changes. I have thought about using a webservice
that periodically checks the database value and sends a response to the page
when the value changes.
>
> Any thoughts on this subject would be greatly welcomed.
>
> --------------------------------
> From: Glynn Brown
>
> -----------------------
> Posted by a user from .NET 247 (http://www.dotn...)
>
> <Id>Hseo0VDXH0iifxsEg7VYDQ==</Id>