Welcome to Professional ASP.NET - Chris Love's Official Blog Sign in | Join | Help

Chris Love's Official ASP.NET Blog

Chris Love's Helpful tips, tricks and pragmatic development knowledge for the ASP.NET world.
Add to Technorati Favorites


ASP Insider Follow Me On Twitter
Applauding Microsoft’s Shift to Improve jQuery!

One of the big announcement at MIX 10 besides the Windows Phone Development stuff was a new jQuery plugin to do data templating. This comes is some very welcome news for me. If you have followed me this year or caught one of my talks I have been spending a lot of time talking about jQuery to WCF messaging. In that demonstration I hope you have seen how I leverage John Resig’s Micro-Templating engine.

I don’t know if you were aware that the ASP.NET AJAX team has also been working on solving the template/data binding problem for AJAX developers. Personally I was not real thrilled with the solution they created because it relied way too much on controls and script injections. For me the most workable solution has been the micro-templates, but I knew there could be better. I had been thinking how to capitalize on the templating in the context of a plugin. Well sometimes you just have to let others that are smarter than you do your work. So during the Tuesday morning MIX10 keynote Microsoft and jQuery announced the templating plugin! More importantly the ASP.NET team announced their future efforts will not put anymore energy into ASP.NET, instead they will be focusing all their AJAX resources on adding to and improving jQuery.

It means that Microsoft is shifting its resources to invest in jQuery. Developers on the ASP.NET team are now working full-time to contribute features to the core jQuery library. Furthermore, we are working with other teams at Microsoft to ensure that our technologies work great with jQuery. – Stephen Walther

I am fully behind this move. The big winners in all this are the users of our sites. We as developers will now be able to developer much richer user experiences with less code and less effort. To me the ASP.NET AJAX framework was clumsy not only in the way you had to develop applications, but in the fat code it injected to the page, which led to a very poor user experience compared to other frameworks that were not tied to any server-side technology.

If you have not made an effort to start learning jQuery to this point I encourage you to do so. It is a rich, easy to use JavaScript framework that adds so much power to the client. Their is a vast and growing eco-system of jQuery plugiins available to solve just about any need you may have. In fact the biggest issue jQuery has is the large number of plugins you have to sort through to find the one that best meets your needs! A plugin is analogous to a control or more like a control extender really.

The following code shows how I use the Valdiator plugin in my WCF/jQuery sample application. In this example the first part is the DOM selector, in this case a FORM with the id of ContactForm. The validate ‘method’ is actually the call to the Valdator plugin. Here I pass in one of the possible parameters, a callback method to execute when the form is valid.

$("#ContactForm").validate({ submitHandler: function(form) {
StoreNewContact();
}
});

I have written about jQuery several times over the past year and plan on continuing with more posts on jQuery and applying it to ASP.NET web sites. But big kudos to the ASP.NET team for fully embracing jQuery and putting their resources behind this fantastic library!

Posted: Tuesday, March 23, 2010 9:12 AM

by Chris Love

Comments

Please said:

Microsoft is going to improve jQuery? Microsoft decided to *use* jQuery after abandoning their attempts to develop a competitor. I applaud you for advocating an outside solution, but let's keep it real.
# March 24, 2010 2:05 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS