I finished that ajax book a few weeks ago. Of course, reading never gets me too far, I always have to have my hands on the ‘ol keyboard for this stuff to actually sink in a bit more. So, i’ve been creating a mashup that is similar in spirit to some of the examples in the book, and using a number of new or emerging technologies to do it (which is great). Its a really simple little 1-pager app that pulls a few concepts together using the asp.net ajax library from Microsoft (and no, i’m not using the simple [but handy] update panel in any of this).
One thing I really noticed while reading the book was how little I’ve leveraged javascript (turns out there’s more to it than getElementById), or used it in a more traditional programming sense (um, except that whole strong-typing thing).
So, i set forth to create a little application that had nothing but a single javascript option instantiated, which internally, did everything from creating the UI, to making all the Ajax calls, to responding to user interaction, etc.
I’ll swing back later and give more details and probably push the javascript goop up here soon, but basically the application brings together a custom database of people and addresses, allows for searching for items, drilling down on more detail on an item, including loading that info into Google maps, and brining in the location’s weather data (from the Weather Channel’s weather feed), and never submits the page.
Again, its really simple (the javascript object which is the workhorse has barely over 230 lines of code), but it does help solidify some of the concepts and features of some of the technologies.
Quick rundown of technologies used for this mashup:
– C# 3.5
– asp.net ajax using the native JSON support
– LINQ to SQL (minor tweaks to the sqlmetal.exe-generated code to work with the JSON serializer though, because the generated code had cyclic references, which that serializer chokes on. Simply comment out an entitie’s parent relationship to avoid that explosion).
– WCF (the new WCF Web programming model in .net 3.5, which is how asp.net ajax can use a WCF service as an <asp:ServiceReference />)
– Google Maps (love google)
– The Weather Channel’s weather feed (very nice, and pretty imagery too!)
– A bunch of CSS positioning, some animated gifs, and a whole lotta fun
I’ll post the code if anyone [reads this blog or…] wants it.
J