The image “http://www.hecgo.com/media/pics/ASP.NET-AJAX.gif” cannot be displayed, because it contains errors.

Microsoft Ajax is Microsoft's free ASP.NET ajax/javascript extension library which is composed of Microsoft Ajax and the extension library, Ajax Control Toolkit. It came out sometime in 2005 - I don't remember exactly when, but it's not until recently that I actually used it extensively.

At first, I was excited about Microsoft Ajax's release; my once bland ASP.NET apps were going to become alive with ajax and javascript! However, after working with Microsoft Ajax for a while now, I'm mostly just frustrated and disappointed. It's dumbed down too much... to the point where a savvy developer will limited and restricted. Sorry Microsoft, wrapping my entire page in an <UpdatePanel> is far from efficient and Ajaxy, even if it does eliminate the "postback flicker."

Also irritating is the name of the Ajax Control Toolkit, which is about the biggest misnomer ever. Most of the controls in this library, albeit useful, have absolutely no Ajax functionality whatsoever. I'm going to make a stab in the dark here and guess that Microsoft's marketing department decided that this title would catch the attention of non-developer people who don't know anything about Ajax... other than that they want it in their application. Boo!

The Sadly Drag and Drop Mentality Re-visted

A while ago, I wrote an article in which I bag on Microsoft for making it possible for developers to drag-and-drop together a web app using ASP.NET and Visual Studio. Well, they tailored towards this style of development with the Microsoft Ajax library, too, and what they ended up creating is a framework that's really only fit for usage in very basic web apps or web apps in which flexibility and performance are entirely unimportant. Unfortunately for us, these are exactly the types of web apps that Average Joe ASP.NET developer seems to create. *Sigh*

Not enough Documentation!

My final grievance is with the documentation for Microsoft Ajax. There's no meaty API that details out all of the javascript behind the Ajax and Ajax Toolkit controls, and this is what I need to know 99% of the time. What I end up doing is painstakingly digging through Microsoft Ajax's complex javascript libraries by hand in firebug... or googling for a solution, hoping that someone else who speaks English has figured it out. Both, obviously, are less than optimal solutions.

Example: I've wanted to trigger the refresh of an <UpdatePanel> control from javascript. This seems like a fairly easy but important feature. You won't find any official documentation on how to do this. If you google for it, you'll find that it can be done using a few methods, all of which are basically hacks that circumvent/trick the normal Ajax framework's behavior. Fantastically not awesome!

I recently started using Ruby on Rails and the Prototype javascript library. The two frameworks are built closely together, similarly to ASP.NET and Microsoft Ajax. However, the documentation for Rails and Prototype is nothing short of awesome.

I'm hopeful that future releases of Microsoft Ajax, if there are any, will address some of these shortcomings that I've repeatedly run into. We shall see, I suppose.

#    Comments [0]

My Roots

My initial plunge into the world of web development started with classic ASP about 3 years ago. I'm sure most developers out there would agree that Classic ASP is not so awesome anymore. Imagine putting VBScript, HTML, and SQL code in a blender, hitting liquefy, and pouring the contents into a ".asp" file. That's, in a nutshell, how most of the classic ASP that I worked with looked. (Obviously, not all classic ASP is this terrible.)

Shortly after doing ASP work for a few months, I was introduced to ASP.NET. I quickly discovered that ASP.NET totally kicked classic ASP's ass; it provided all sorts of cool server-side controls and the power of the .NET framework. Couple that with some tight integration into Visual Studio, and here's what you have:

bmw-z4           AND              junkCar
ASP.NET (BMW Z4)   Classic ASP (Rusted Junk Box)

A year later, Visual Studio 2005 and ASP.NET 2.0 came out and made things even sweeter. A number of outstanding issues in Visual Studio 2003 and ASP.NET 1.1 were addresses and plenty of cool new enhancements were added. How could things get any better? I had become a stanch ASP.NET supporter.

Along comes Rails

Chad Fowler suggests that we developers should try to learn at least one new programming language per year. Not because we may be using a new programming language at your day job, but because it will broaden our minds and give us new perspective and insight into solving problems.

This is exactly what happened to me. I used Ruby on Rails (RoR) to create a web-based IRC-like chatting app. After learning the in's and out's of RoR, I've since returned to writing ASP.NET, frequently finding myself working on a piece of code and thinking, "how would I do this in rails?" More often than not, I end up perturbed and unsatisfied, knowing that rails would allow for a simpler and cleaner solution. Blarg!

Without going into all of the technical details, I've concluded that RoR's is superior to ASP.NET in that it:

  • has a true model/view/controller (MVC) implementation
  • is way better at handling Ajax requests
  • can cleanly handle URL rewriting
  • has as a sweet ORM tool, ActiveRecord, baked right into the framework
  • requires little-to-no initial configuration
  • built-in testability
  • makes it more difficult for the developer to write crappy, inelegant code (note: it does not eliminate the possibility.)

I'll talk be talking about the Convention over Configuration in my next post in this series

#    Comments [2]