Geeks With Blogs
AzamSharp Some day I will know everything. I hope that day never comes.

A week ago I started a poll in which I asked "Which Ajax framework do you mostly use?" with the following choices:

 

ASP.NET AJAX

 

AJAX PRO Library

 

Anthem.NET 

Plain XmlHttp Object

The winner by a long margin was the MS ASP.NET AJAX. Surprising! not really. MS ASP.NET AJAX framework might not be the slickest framework in the market but without any doubt it is one of the easiest one to use. The real power lies in the UpdatePanel control which can update a portion of the page using client side postbacks. Just put your control inside the UpdatePanel and it will do the rest (at least for most of the cases).

Performance wise ASP.NET Ajax framework is not good. There are couple of reasons. First the size of the Client Framework JavaScript library is pretty huge. Second although it is asynchronous it does follow the complete life cycle of the page which kills the performance. The selling point of the MS ASP.NET AJAX is that it took away the complexity to build the updated user interface.

Let's consider a real world scenario. The poll control which is displayed on the GridViewGuy is NOT using the ASP.NET AJAX framework. It uses ASP.NET 2.0 client callbacks to make XmlHttp requests to the server's method. Each time you mark a choice and submit your vote I build the user interface for the result of the poll on the server side. The processing can be done on the client but that requires lot of JavaScript. Anyway, MS ASP.NET AJAX helps you to forget about the updated interface as the UpdatePanel takes care of that and because the whole page life cycle is repeated with the ViewState and stuff.

So, which Ajax framework should you use?

My humble answer will be to mix it up. Use MS AJAX where the user interface update is complex and use ASP.NET client callbacks OR third party libraries when making simple calls and making simple updates. The reason I pressed on using ASP.NET AJAX when the interface is complex is because you definitely don't want to create the interface again. So, leave this job for ASP.NET AJAX UpdatePanel.

Posted on Friday, November 2, 2007 9:39 AM | Back to top


Comments on this post: Choosing an Ajax Framework Performance vs Easability

# re: Choosing an Ajax Framework Performance vs Easability
Requesting Gravatar...
AJAX PRO + jQuery for me

If I'm lazy, I use MS Ajax :)

But with MVC on the way, I'm sticking with AJAX PRO and jQuery!
Left by Zack Owens on Nov 02, 2007 10:35 AM

# re: Choosing an Ajax Framework Performance vs Easability
Requesting Gravatar...
Hi Zack Owens,

I love AJAX PRO. So, how do you build your UI (updated UI)? Do you build the UI on the server side and then return the HTML to the client or do you prefer creating the UI on the client side using JavaScript?
Left by Mohammad Azam on Nov 03, 2007 8:08 AM

Your comment:
 (will show your gravatar)


Copyright © Mohammad Azam | Powered by: GeeksWithBlogs.net