Chapter 34: ASP.NET AJAX


Overview

Web application programming is an area that is subject to continuous change and improvement. In the previous two chapters, you have seen how to use ASP.NET to create fully functional Web applications, and you may think that you have seen all the tools that you need to create your own Web applications. However, if you spend much time looking at current Web sites, you may have noticed that more recent Web sites are significantly better, in terms of usability, than older Web sites. Many of today’s best Web sites provide rich user interfaces that feel almost as responsive as Windows applications. They achieve this by using client-side processing, primarily through JavaScript code, and increasingly through a technology known as Ajax.

This change of direction is possible because the browsers that clients use to browse Web sites, and the computers that clients use to run browsers, have become more powerful. The current generation of Web browsers, such as Internet Explorer 7 and Firefox, also support a wide variety of standards. These standards, which include JavaScript, enable Web applications to provide functionality far in advance of what was previously possible using plain HTML. You have already seen some of this in previous chapters - for example the use of cascading style sheets (CSS) to style Web applications.

Ajax - as you will discover shortly - is not a new technology. Rather, it is a combination of standards that makes it possible to realize the rich potential functionality of current Web browsers.

Perhaps the key defining feature of Ajax-enabled Web applications is the ability for the Web browser to communicate with the Web server in out-of-band operations; this is known as asynchronous, or partial-page, postbacks. In practice, this means that the user can interact with server-side functionality and data without needing a full-page refresh. For example, when a link is followed to move to the second page of data in a table, Ajax makes it possible to refresh just the table’s content rather than the entire Web page. This means that there is less traffic required across the internet, which leads to a more responsive Web application. You will see this example in practice later in this chapter, as well as many more examples that illustrate the power of Ajax in Web applications.

You will be using Microsoft’s implementation of Ajax in the code in this chapter, known as ASP.NET AJAX. This implementation takes the Ajax model and applies it to the ASP.NET framework. ASP.NET AJAX provides a number of server controls and client-side techniques that are specifically targeted at ASP.NET developers and enable you to add Ajax functionality to your Web applications with surprisingly little effort.

In the first part of this chapter, you will learn more about Ajax and the technologies that make Ajax possible. In the second part of this chapter, you will learn about ASP.NET AJAX and its component parts, as well as the functionality that ASP.NET AJAX offers. In the third and largest part of this chapter, you will see how to use ASP.NET AJAX in your Web applications, by using both server-side and client-side code.




Professional C# 2005 with .NET 3.0
Professional C# 2005 with .NET 3.0
ISBN: 470124725
EAN: N/A
Year: 2007
Pages: 427

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net