Friday, February 22, 2008

Many months ago I wrote a post on AJAX toolkits for ASP.NET. Things have moved on a bit since then. Mainly Microsoft ASP.NET Ajax was released.

OK I still have concerns that Microsofts AJAX solution is overweight. However thats what the cache is for ! Overall I think that I would use Microsofts AJAX solution because its likely to be ubqitous so you are plugging into a community of code and Microsofts continuing development and integration into Visual Studio.

The UpdatePanel is great in that it makes it very quick and easy to ajaxify a website, the downside is network traffic may be much higher than you expect. So the updatepanel is great to impress your boss and get something working quickly, but I really recommend reading a copy of ASP.NET Ajax in Action. Its got a foreword and quote from Scott Guthrie and you cant really get a better recommendation than that. It tells you how to use the Microsoft JavaScript library - so maybe you can replace your use of JQuery/Prototype and standardise on Microsoft functions a lot more.

One of the best things I have found so far is AJAX Control Extenders. That JavaScript function you wrote that adds some functionality to a textbox ( for example ). You can now easily wrap it up inside a Control Extender. Now any developer in your company can attach your JavaScript behaviour to any TextBox, by clicking on smart tags inside Visual Studio 2008. I have done one of these extenders myself and its really very quick to do.

Even better theres a free library of controls and extenders, with source code, that anyone can contribute to. You can find it here : http://www.asp.net/ajax/ajaxcontroltoolkit/samples.
This is a collobration between Microsoft and the community.

I am little vexed by Microsofts determination to make the clientside look more like the serverside. Do we really want a page event cycle on clientside as well as serverside ? Maybe this will grow on me though. I would really hope developers would take the time to learn the differences between client and serverside and get some reasonable understanding of how to write their own JavaScript which doesnt rely on Microsofts library without being informed of the choices.

AJAX.NET Professional is still out there but development has now stopped.
Find it here : http://ajax.schwarz-interactive.de/CSharpSample/
Michael Schwarz did a great job on this in his free time and I enjoyed using this.

I havent used http://ajaxwidgets.com but have looked at a couple of demos and it looks really slick. Last time I looked it wasnt free but looks like they may have now changed the licencing model. Main issue its not Microsoft so not sure how it will survive long term. With this system you write what looks like serverside code, e.g. in an onclick event for a button, but its actually automatically actually run via AJAX call. I am sure there is more to it than that though ...

As I say my recommendation would currently be to use Microsoft ASP.NET Ajax for projects, though if you only want to use a little AJAX and want more control I still have a fondness for Ajax.Net

No comments: