tags:

views:

109

answers:

2

How an AJAX application like those written in ASP.NET AJAX informs client the events fired in server? I meant some application like Gmail. Gmail tells the client whenever a new email has been arrived. I'm very interested how is done in ASP.NET AJAX using UpdatePanel. I know UpdatePanel has a Triggers property, but it works only with Controls events not events of my own classes.

+1  A: 

Ajax applications check server state continously to achieve this effect. They always work as clients and cannot receive requests from server.

empi
Thanks for reply but does it affect performance and band width consumption because of continuous connection to server?
afsharm
To be precise, you are not continously connected to the server (connection is closed after every request) but you have to make requests to the server continously (e.g. every 10 seconds). I don't think there could be any performance penalty on bandwidth, since ajax messages are usually very small (response usually is in xml and is about a few kilobytes long). The only problem is the polling model you are using - you're polling even though there could be no new messages. If you're looking for duplex communication check e.g. java applets.
empi
A: 
Rachel