Google Brother Up

2008/06/26

Can AJAX be implemented in Windows Application?

Well technically you can use it in a windows application....

The long way to implement AJAX in a windows application.

just not in the way you may of intended. Since ajax is essentially asynchronous javascript and xml, you would need to use some sort of javascript engine (mozilla has a good one called SpiderMonkey which is written in c) and an XML parser, MSDOM or any standard lib would do. Create a class that implements the functionaly similar to a .NET 2.0 HttpRequest ( especially its asynchronous features ) and then export that class as a custom object so that it can be accessed by the javascript engine, being sure to implement the standard exception and errors found in regular XmlHttp calls. Once all of this is written you can write a windows application that loads a javascript file from anywhere, processes it (Either synchronously, or asynchronously) and returns the results so you can handle it appropriately.

The short way to implement AJAX in a windows application.

Quite simply, don't. The biggest feature of Ajax is that it simulates many windows applicsations ability to provide data on demand with out any postbacks or whatever. You can tweak your windows application to go above and beyond what Ajax could do by researching multithreading and the WinForms API and learning how to stream data from its source and automatically propagate that to the UI with out causing a noticeable wait to the main ui thread. But thats more into data visualization & web 2.0 centric than AJAX in itself.

No comments:

Drop Down List

1. http://www.janetsystems.co.uk/Articles/NetArticles/tabid/74/itemid/161/modid/449/Default.aspx