While reading the comments on Armand's AJAX Wrapper DLL post, I got the impression that readers weren't quite sure about the benefits of AJAX.
AJAX has two huge benefits:
- Speed and invisibility (ala smart client) makes for a very slick user experience.
- The smaller server resources footprint helps server scalability (seriously!).
I'll explain. If you post using AJAX, only the data (or parameters) that the server function requires is posted. In a login scenario, only the username and password strings (100 bytes maybe) are sent to the server and only a boolean value (1 byte) is returned. This means that only 101 bytes (excluding network handshaking traffic) is sent & received. For this same functionality using ASP.NET all the state data is pushed and the whole page is returned. In a conservative case, when a page might be 20k, you will literally produce 99.5% less traffic when using AJAX.
Further more; when using AJAX your web server and or db server (or whatever your config is) does not have to do any processing other than running the called function and returning the return value. No page load events, no xsl transform etc. This can have a huge impact in an enterprise environment. Case in point: While working on a huge financial services CRM package, we were able to improve usage from 150 users/minute to 250 users/minute with an AJAX implementation.
The one thing that you do have to be careful about is security. Without proper security, you're left wide open (much more than with ASP.NET). Currently there is no security in the .NET wrapper Armand mentions. But in a response to one of my comments, Michael Schwarz indicated that this is something on his roadmap.
Oh yes and AJAX is absolutely disconnected. In the same way as a normal web page or a smart client, AJAX has no idea of state.
My final thought: Using AJAX you can have the flexibilty of a browser, but the slickness and reduced network traffic of a smart client. Highly recommended.
My final final thought: Be sure to let Michael Schwarz know that you would love to see his very useful AJAX .NET Wrapper as an open source project.