Friday, March 9, 2007

Why use ASP.NET AJAX

By Omar Al Zabir

When others see Pageflakes, the first question they ask me is: "Why did you not use Protopage or Dojo library? Why Atlas?" Microsoft Atlas (renamed to ASP.NET AJAX) is a very promising AJAX framework. They are putting a lot of effort on it, making lots of reusable components that can really save you a lot of time and give your web application a complete face lift at reasonably low effort or changes. It integrates with ASP.NET very well, and it is compatible with the ASP.NET Membership and Profile provider. The AJAX Control Toolkit project contains 28 extenders which you can drag & drop on your page, tweak some properties, and add pretty cool effects on the page. Check out the examples to see how powerful the ASP.NET AJAX framework has really become.

When we first started developing Pageflakes, Atlas was in infant stage. We were only able to use the page method and Web Service method call features of Atlas. We had to make our own drag & drop, component architecture, popups, collapse/expand features etc. But now, you can have all these from Atlas and thus save a lot of development time. The web service proxy feature of Atlas is a marvel. You can point a<script> tag to a .asmx file and you get a JavaScript class generated right out of the web service definition. The JavaScript class contains the exact methods that you have on the web service class. This makes it really easy to add/remove new web services, and add/remove methods in web services which does not require any changes on the client side. It also offers a lot of control over the AJAX calls, and provides rich exception trapping feature on the JavaScript. Server side exceptions are nicely thrown to the client side JavaScript code, and you can trap them and show nicely formatted error messages to the user. Atlas works really well with ASP.NET 2.0, eliminating the integration problem completely. You need not worry about authentication and authorization on page methods and web service methods. So, you save a lot of code on the client side (of course, the Atlas Runtime is huge for this reason), and you can concentrate more on your own code than building up all these framework related code.

The recent version of Atlas works nicely with ASP.NET Membership and Profile services, giving you login/logout features from JavaScript without requiring page postbacks, and you can read/write Profile objects directly from JavaScript. This comes very handy when you heavily use ASP.NET membership and profile providers in your web application, which we do at Pageflakes.

On earlier versions of Atlas, there was no way to make HTTP GET calls. All calls were HTTP POST, and thus quite expensive calls. Now, you can say which calls should be HTTP GET. Once you have HTTP GET, you can utilize HTTP response caching features which I will show you soon.
Read More

No comments:





Google