ASP.NET AJAX 4.0: Microsoft did it! They married the DOM and client-driven data!

by Jon Davis 3. November 2008 01:03

For over a year I've been going through a discovery process, with one pet project after another, of how it might be possible to glue Javascript objects and DOM objects together and keep them synchronized with a server in two-way data binding. And, to do it in a way that was elegant, readable, terse, trivial, and blatantly obvious and sensible. I usually failed to see this as my actual objective--I sought to find solutions to more specific problems whereby this would be the ultimate ideal.

A long while back, I came up with a script library I called Sprinkle. I created a domain name for it, I mentioned it to, and they featured an article on it. Somehow, Sprinkle disappeared and was forgotten (an oversight on my part) and no longer points anywhere.

But what Sprinkle did was quite simple. It allowed you to put src="..." on any DOM element, within reason, particularly <div>'s for HTML injection and <input>'s for default values populated from URL GETs. Then I sought to make it XHTML-compliant by using the DTD extensions spec whereby I was allowed to add my own attributes (like 'src=..') to existing declared elements (like <div>). Problem was, the browsers generated junk characters at the top of the page when I did that, so I had to use script to strip off the junk characters. The whole thing became a mess, for one simple lightweight proof of concept, and I hadn't even begun to tinker with advanced HTML and 2-way binding.

At one point a co-worker and I created a client-side MVC framework where we ended up creating DOM object assignments to "client controls" that would effectively be able to manipulate their associated DOM objects as though they were properties (which indeed they were). Nothing special in itself but it was another example of where we were marrying HTML and script. Ultimately my co-worker did most of the implementation work on that. I helped do a lot of architectural design of it, but he pointed out a lot of issues we had to work through such as dealing with composite ASP.NET server controls that defined our own client control--ClientID issues, for example, in a tree of control containers, one control nested after another.

And in my previous post I brought the whole matter up again and pondered even simple one-way data binding from scratch all over again. In the end I figured (and noted) phooey, just use client-side templates, jQuery, and JSON web services. You still, however, and up with a lot of manual work in some ways.

Anyway, the Web Forms dependency in ASP.NET AJAX made ASP.NET AJAX a complete turn-off to me all this time. I think my previous post pretty well documents why Web Forms is worth hating, most notably the evil <head runat="server"> and <form runat="server"> tags and how they completely mess everything up in a client-oriented web app.

While I reserve room for skepticism, ASP.NET 4.0 makes some promises in favor of lightweight view templates to such an extent that I'm raising my eyebrows and thinking it's worth blogging about. I'm not sure where I was back in July or so when it was announced but the new 4.0 platform promises a whole new approach to building web apps for the client. With the new ASP.NET 4.0 client templates [2], XHTML is cleanly extended using XML namespaces, and databinding and HTML templating is performed using DOM API abstractions (and jQuery) rather than server-side templating logic. What this will mean in the practical sense is yet to be proven but right now I'm thinking, holy cow. The panacea I just spoke of in my previous post has finally arrived, I think.

But let's not get ahead of ourselves. Fortunately, the proposed new ways of doing things the ASP.NET AJAX way are preview downloadable and the downloads already fetchable. We should play with this thing and provide feedback.

More info, and proof that I was a little late to the party, is at:

.. and officially here:

kick it on

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Web Development


Powered by BlogEngine.NET
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 

Tag cloud


<<  May 2021  >>

View posts in large calendar