News Stay informed about the latest enterprise technology news and product updates.

Programming for the ASP.NET AJAX interface

ASP.NET AJAX, having been built atop ASP.NET, is tightly coupled with the .NET Framework. This server-side model works well for basic applications, but advanced apps will need some client-side work, experts say.

Our ASP.NET AJAX series
In this three-part series, takes a close look at ASP.NET AJAX development.

Part 1 takes a look at what makes programming with ASP.NET AJAX different from programming with ASP.NET.

Part 2 considers the capacity for ASP.NET AJAX applications to operate faster, and on a larger scale, than traditional ASP.NET apps.

Part 3 examines the security concerns raised by ASP.NET AJAX development and offers some thoughts on how to combat them.
In a span of two years, Ajax has gone from buzzword to Web development mainstay. As end users clamor for this easy-to-use functionality, developers are increasingly looking for ways to incorporate Ajax (Asynchronous JavaScript and XML) into applications both old and new.

"Many people are interested in Ajax after having seen some of the amazing mashups like Google Maps. A lot of our enterprise developers have sat up and are taking notes," said Brian Finnerty, director of marketing for InnerWorkings, a Windows programming consultancy.

The user experience generated by Ajax is more fluid, as it allows applications to integrate multiple Web services into a single interface. In addition, it can provide faster response times, as less information needs to be interchanged between the browser and the server.

In the Microsoft programming community, ASP.NET AJAX is gaining momentum as a way of improving the user interface while leveraging the existing base of ASP programming experience. However, some limitations do remain.

For basic applications, the ASP.NET AJAX programming model itself is not significantly different than what programmers are used to with ASP.NET. "The ASP.NET AJAX model, built on the existing ASP.NET model, is not a case of throwing out everything you know and starting over," said Jeff Prosise, co-founder of Wintellect, a .NET consultancy. "It has some new controls, but the model is consistent with the ASP.NET controls."

But more advanced application development does require a bit of a shift, Prosise noted. "If you want to do some of the advanced stuff you can get at a completely different model, but most programmers will not do that," he said. "ASP.NET is a server-centric model. Ajax does most of its work on the client side using a JavaScript framework, which is totally different than ASP.NET."

Many people are interested in Ajax after having seen some of the amazing mashups. A lot of our enterprise developers have sat up and are taking notes.
Brian Finnerty
director of marketingInnerWorkings

To build advanced apps, a programmer can leverage the client-side framework to create more sophisticated effects. They can build classes in JavaScript, which is normally not possible with ASP.NET. They can also customize the behavior of some of the server-side Ajax controls.

"Minimizing what you send to the server is one small part of it. The untold story is that it is not only a server framework -- it is a client framework as well," Prosise said.

ASP.NET AJAX also eases some of the browser pain that comes with Ajax, as each of the major browsers -- IE, Firefox, Opera and Safari -- treats Ajax a little differently. (Additional information on cross-browser compatibility in Ajax is available in Tutorial: Cross-browser Ajax by Ross Shannon.)

"If you are hand-coding Java, it is normally difficult to make it work on a lot of different browsers. You needed to write one set of code for Internet Explorer, and another set of code for Safari on the Mac," Prosise noted. "In ASP.NET Ajax, you just need to write the framework of abstraction to the model, and then it works for Safari or IE under the hood. [Y]ou are not having to write six different sets of Java code for six different browsers."

Photo sharing has been using ASP.NET AJAX to create a web-based version of its photo sharing service.

Michael Cichowski, software engineer at Phanfare, said the company looked at using Ruby on Rails, Linux, and MySQL for the site but decided that ASP.NET AJAX made the most sense, because it was tightly coupled to .NET. In addition, Cichowski said the company liked the way ASP.NET AJAX handled Web service calls and the ease of use when plugging an existing ASP.NET framework into Ajax.

One limitation to the Ajax interface, though, has been the limited access to native Windows resources. While this reduces the amount of damage that rogue Ajax code could do on the client, it also limits a programmer's options in certain areas.

ASP.NET AJAX Learning Guide

Tip Series: Get started with ASP.NET AJAX development: Part 1  |  Part 2  |  Part 3

"The one thing we wanted to do, but have not figured out how with ASP.NET AJAX, has been to implement a drag-and-drop file uploader from the local computer," Cichowski noted, adding that Web application security presented a challenge in this case as well. "You need some kind of ActiveX control or a Firefox plug-in, which is a huge hurdle to overcome. We went down the Java applet path, but that defeats the whole purpose of a lightweight application."

In order to overcome this limitation, Phanfare has been using Adobe's Flash, which has a multifile uploader for this purpose, Cichowski said.

Dig Deeper on ASP.NET and Ajax development

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.