Automatic updating an ASPX page

  • Thread starter Thread starter t@t
  • Start date Start date
T

t@t

Hello,

I have 2 applications, communicating with web-services. One application is
an ASP.NET application. This is sometimes updated with some data by the
other application by means of a web-service.

The ASPX page of this ASP.NET application should always display the actual
status of that data. How can I manage this the best?

One option I already implemented is to add javascript to that page:
'window.setInterval' or 'window.setTimeOut' to do a postback each second to
the server side. This works. However, I am afraid this polling scheme is not
as efficient as possible. Are there other options to update the page?

Is the IHttpAsyncHandler an option to use? To do a asynchroneous call to the
application, and let the spawn pplication thread end this request when new
data is received? Or will this not work?

In my opinion this is a very common problem and is probably already solved
many times. Waiting for your hints.

Regards,

RAK
 
Hi RAK:

There is no way to push data to the client in ASP.NET unless the
client has made a request - thus, polling and refreshing are the way
to go, unless you want to write software to install on the client's
machine that keeps an open connection to the server.
 
One option I already implemented is to add javascript to that page:
'window.setInterval' or 'window.setTimeOut' to do a postback each
second to the server side. This works. However, I am afraid this
polling scheme is not as efficient as possible. Are there other
options to update the page?

In my opinion this is a very common problem and is probably already
solved many times. Waiting for your hints.

This is how the infrastructure works. If you don't want to use browser based
apps, then you can build a desktop style app and you can then build in these
sorts of asychronous notifications much easier.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
Hello,

Indeed, but after some googling I found that ASP.NET 2.0 provides Client
Callbacks, which will provides a better and more efficient solution.
However, this takes still some months...

In the meantime I found also PowerWEB LiveControls for ASP.NET. They are
promising! I downloaded a trial version and am able to do callbacks without
reloading the whole page each time.

Kind regards,
RAK
 
Indeed, but after some googling I found that ASP.NET 2.0 provides
Client Callbacks, which will provides a better and more efficient
solution. However, this takes still some months...

Yes, but it's no different -- the code in the browser has to poll the server.
The main difference in 2.0 is that you don't actually post the page, and
thus you don't get the refresh. It's still the same underlying infrastructure.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
Back
Top