I want it to be small
I want it to be fast
I want it to be extensible
I want good documentation and/or community support
I want good/easy AJAX support
I want it to be asp.net-friendly
I also want it to be testable (I am using TDD for this project/book)
Open Source would be nice but not required
This is a shortlist but if you want a more exhaustive, read this. I only picked these, for the simple reasons that I have heard of them and are somewhat known by the community.
3 days later
It’s been 3 days since I started this post and I have spent all that time playing around with these libraries… I have gone back and forth in my opinion on which library to use. I love jQuery’s selectors, ease of use and community support. Porototype is also very popular and somewhat similar to jQuery; but I would take jQuery over Prototype for the simple reason that I like jQuery. YUI (Yahoo! UI) library is beautiful looking and very comprehensive.
Couldn’t find a testing framework (but I didn’t look too hard)
For some purely emotional reason, I prefer jQuery
Great UI components and styles
The best documented library out there, hands down.
Distributed hosting of JS files – the script files will be downloaded from Yahoo server, so when my site becomes a mega-hit, it will scale better.
Great test framework and test runner – check these demos
The most complete library
PDF cheat sheets for every component
Very verbose – not as elegant as jQuery, but that’s not too hard to fix e.g. I can assign YAHOO.util.Event to a variable $E and use $E as the shorthand.
I got tired of all the research and decided to wrap it up, so I glanced over Microsoft AJAX and Dojo and realized that there isn’t enough there to justify more research.
Yesterday, I gave a talk at CMAP Code Camp about the asp.net mvc framework and AJAX using JQuery. This is my first time speaking, so I was a little nervous. I think I did ok but I can’t really tell. Of course, the talk didn’t go as planned, because Visual Studio didn’t cooperate. Thankfully, I had a Plan B and pulled up code that I had already prepared and just walked through it and explained it. I wanted to give more details but I didn’t have enough time.
So, if you have attended the talk, I would love to hear your feedback, so please leave me a comment or send me a not through the contact page.
There are also tons of JQuery resources at www.jquery.com and I found this handy JQuery 1.2 cheat sheet (remember: this is for version 1.2)
“According to most studies, people’s number one fear is public speaking. Number two is death. Death is number two. Does that sound right? This means to the average person, if you go to a funeral, you’re better off in the casket than doing the eulogy.” – Jerry Seinfeld.
This is the updated version of the Nikhil’s excellent example on how to use Ajax with ASP.net MVC.
I commented all the changes made in the code and prefixed them with //emad. So just search for //emad and you will see all the changes I made… Here is a quick list of the changes I made to make this compile and run on MVC Preview 2:
Removed the [ControllerAction] tags – they are no longer needed.
Updated the Route Table creation in the global.asax.cs file to work with the new format
Updated the Ajax framework project to use the new classes
HttpContextBase instead of IHttpContext
HttpRequestBased instead of IHttpRequest
HttpResponseBase instead of IHttpResponse
Updated the AjaxViewContext constructor to match ViewContext constructor
Changed the web.config to work with the new version (copied and pasted from another preview 2 project)
Note: Test project was not updated and will not compile – sorry, I didn’t have time to do it.
I wrote an article at code project which was entered for a competition. The winner gets $10k. Can you please check it out at http://www.codeproject.com/KB/WCF/myfeedreader.aspx and if you like it, please vote for it. I can’t win if you don’t vote. Voting will be closed on December 31st.
To vote, you need to login and find the voting area at the bottom that looks like this: