This post originated from an RSS feed registered with .NET Buzz
by Brendan Tompkins.
Original Post: Getting Started with AJAX on ASP.NET
Feed Title: Brendan Tompkins
Feed URL: /error.htm?aspxerrorpath=/blogs/brendan.tompkins/Rss.aspx
Feed Description: Blog First. Ask Questions Later.
Iâm nearly done with a new version of WSMQ that runs on ASP.NET 2.0 and contains a nice snazzy new AJAX interface. Since along the way I learned a little about this new fangled technology, I thought Iâd post a bit of information Iâve gleaned about the different options that you have currently for developing AJAX enabled web apps on ASP.NET.
Oh, youâre still here.. Okay, well, so you you may be wondering how to get started implementing AJAX within your own applications.
What is it AJAX Again and what does it have to do with ASP.NET?
You know, that Live.Com Google Maps stuff. Basically AJAX is dynamic web content without the postbacks. To implement it, however, it requires more than a few technologies on top of ASP.NET to get going. Specifically it requires manipulating the Document Object Model through JavaScript to dynamically display and interact with the information presented, and the use of the the XMLHttpRequest object to exchange data asynchronously with the web server. So when youâre faced with implementing AJAX in your web apps you have to make some decisions about how much help youâre going to get with all this stuff.
There are the brave few that will decide to go it alone, and code directly to the browserâs object model. If you are interested in rolling your own scripting the browserâs XML HTTP functionality, thereâs a good article here on how to do just that.Sahil a while back posted an example on how to create a progress bar using AJAX. The problem with this approach is that it requires knowledge of a multitude of technologies, and Iâve found this can be quite tricky to code, debug and maintain. If youâre like me, you want to spend less and less time writing client end code and concentrating on something more re-usable.
Just the AJAX Script Libraries, Please Thereâs more than a few Javascript libraries around which do the dirty work of DOM manipulation and XMLHttpRequest processing for you. One option for deploying an AJAX app is to implement your solution based on one of these libraries. Youâre still going to need to know quite a bit about JavaScript to use these libraries, but they are out there if you need them.
âPrototype is a JavaScript framework that aims to ease development of dynamic web applications. Featuring a unique, easy-to-use toolkit for class-driven development and the nicest Ajax library around, Prototype is quickly becoming the codebase of choice for web application developers everywhere.â
âSarissa is a cross-browser ECMAScript library for client side XML manipulation, including loading XML from URLs or strings, performing XSLT transformations, XPath queries and more. Supported: Gecko (Mozilla, Firefox etc), IE, KHTML (Konqueror, Safari).â
ASP.NET Ajax Implementations
So if what you really want to be doing is concentrating on business logic, application design and creating loosely coupled applications that your organization can reuse and build upon, you donât want to be wasting a ton of time coding up in the UI. Especially since youâre probably going to have to rewrite the UI again anyway when the next new presentation technology comes out. The fastest way to implement AJAX, given this, is to use an implementation that quickly plugs into the ASP.NET framework and allows you to write the least amount of custom AJAX code. There are a couple of alternatives for doing just this.
This is a free, open source AJAX library is written by Michael Schwartz. From what I can tell, it seems to be very poplar, although the project seems to have branched a bit and itâs kind of hard to tell where itâs headed. Thereâs a good MSDN article here that will help you get up and running using Ajax.NET.
Jay Kimbleâs implementation based on the Sarissa AJAX library. Uses method attributes to declare AJAX-accessible server code. Jay can tell you more, in fact heâs right next door..
ASP.NET âAtlasâ is a package of new Web development technologies that integrates an extensive set of client script libraries with the rich, server-based development platform of ASP.NET 2.0. âAtlasâ enables you to develop Web applications that can update data on a Web page by making direct calls to a Web server â without needing to round trip the page. With âAtlasâ, you can take advantage of the best of ASP.NET and server-side code while doing much of the work in the browser, enabling richer user experiences.
Microsoftâs AJAX offering is pretty nice.. It was demo-ed in the PDC 05 keynote which I missed unfortunately⦠Comes with a Visual Studio web site template, and quite a large feature set. I managed to get a simple AJAX web form implemented in a matter of minutes. Scott Guthrie has a great walk through here for creating a quick Atlas app.
This is the AJAX implementation that Iâm most familiar with. Itâs pretty sweet. âAdds cutting-edge AJAX (Asynchronous JavaScript and XML) functionality to the other components in the Web.UI suite and also "AJAX-enables" virtually any ASP.NET control!â
âr.a.d.callback is a suite of AJAX-enabled UI controls, which allow you to update page content without postback and loss of scroll position. The short response time combined with the smooth interface transitions results in superior users experience and level of interactivity, which can only be found in desktop applications.â
Is that it? Heck no! Iâm sure Iâve failed to mention more than a few technologies that are out there. If you know of any, please post them via a comment here.