08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 11 ■ <strong>AJAX</strong> APPLICATIONS AND EMPOWERING THE WEB USER EXPERIENCE 277<br />

}<br />

currentPic--;<br />

ShowPic(currentPic);<br />

function DoNext()<br />

{<br />

currentPic++;<br />

ShowPic(currentPic);<br />

}<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

This technique <strong>and</strong> methodology will prove very useful when you’re building your<br />

applications. It also introduces a whole new way of thinking about the user experience.<br />

Forward caching changes the way in which many applications (e.g., maps) can be presented<br />

to the user. If you are building an application that could make the most of this, it’s<br />

well worth thinking it through <strong>and</strong> building it into your site.<br />

Summary<br />

In this chapter, you took a look at Ajax, seeing some examples of applications where Ajax<br />

greatly improves the overall user experience, such as MSN MoneyCentral <strong>and</strong> Google<br />

Maps. You looked at the history of dynamic, partial page refresh technologies, leading up<br />

to the XMLHttpRequest object, for which the technique of Ajax was coined.<br />

You looked into the architecture of Ajax <strong>and</strong> how you can use the XMLHttpRequest<br />

object in code, before delving into a couple of examples. The first example, though very<br />

simple, demonstrated straightaway that the instant-feedback nature of Ajax (as opposed<br />

to the traditional delayed-via-postback feedback of a web application) can improve your<br />

end users’ experience.<br />

You then looked into another major technique used by Ajax programmers: forward<br />

caching. This technique is used by applications such as mapping applications to allow<br />

users to get what seems to be instant access to data. Applications using this technique<br />

are smart enough to download <strong>and</strong> cache data that would likely be requested next. When

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!