1

Simple AJAX model is to request some information to the server and the server returns response. If i am correct then it is called as a pull model.

However while reading some of the web 2.0 concepts i have came across push model stuff say for example the real time application like displaying the shock exchange price update on the web page. Where server is pushing the information to the client frequently and client updating the information.

Now how can i implement this behavior using ASP.NET or there is other framework that i have to use for this purpose ? Or is this just a theoretical model ?

Anil Namde
  • 6,452
  • 11
  • 63
  • 100

2 Answers2

2

Please see the following link: Comet implementation for ASP.NET?

you can use a framework like http://pokein.codeplex.com/ to achieve what you are looking for. Otherwise, for your stock exchange price example, most of them just have javascript that initiates a request to refresht the data from the client side.

Community
  • 1
  • 1
clyc
  • 2,420
  • 14
  • 15
0

Common approach is the use a client-side timer created with JavaScript and request for new data. If there's no updated data, response has some flag so there's no need of updating anything in the UI.

Just play with setInterval JavaScript function and AJAX.

Matías Fidemraizer
  • 63,804
  • 18
  • 124
  • 206
  • but that means so many unnecessary requests getting on to the server. Causing more load ... right? – Anil Namde May 31 '11 at 14:35
  • Yes, but if you use JSON, how much would cost a simple request to some Web Service operation and get a `{ "hasData": "false" }` response? It's a very small cost. For now, any other approach like comet is forcing the Web to work as a classic persistent TCP socket and this isn't possible yet in current Web implementation. – Matías Fidemraizer May 31 '11 at 14:38
  • You need to configure this time interval with some reasonable value, for example, every minute, or 30 seconds, but avoid every 300 miliseconds. – Matías Fidemraizer May 31 '11 at 14:39