Preface


The Wikipedia page for Ajax (http://en.wikipedia.org/wiki/Ajax) provides more than 20 meanings for the word, including the names of two characters in Homer's Iliad (Ajax the Great and Ajax the Lesser), the name of an Amsterdam soccer team, a couple of automobiles, a horse, andmy personal favoritea household cleaner made by Colgate. However, Ajax is also the term for a collection of technologies many say could revolutionize the Web. If various weblogs and online and print commentaries are to be believed, Ajax is the future of web development, the enabler of Web 2.0, and probably a cure for fatal diseases, as well.

Many web developers want to provide their users with a far richer client experience but don't want to (or, for practical reasons, cannot) write a Windows client application. Ajax could be just what they need. It allows web applications to behave almost like desktop applications, with features such as keyboard shortcuts and drag and drop.

ASP.NET "Atlas" (or Atlas, as we will refer to it throughout this book) is the code name for a new set of technologies from Microsoft that provide Ajax-like functionality for the ASP.NET developer, offering many of the same benefits for Ajax development that ASP.NET provides for server-side development.

I have resisted writing about Ajax for quite some time. I have used the technologies that make up Ajax for years, and I have written about each individually, but the term Ajax had to be coined in early 2005 before the technology really took off. In my opinion, Clemens Vasters said it best: "Web 2.0 yadda yadda AJAX yaddayadda Profit!(?)" (see http://staff.newtelligence.net/clemensv/PermaLink,guid,d88c1112-d8da-496e-9fd0-8cf03cf55c32.aspx). The hype kind of reminds me of the buzz that accompanied XML and web services a few years back: everybody was talking about them, but few had ever read their specs.

Once reality settled in, the hype vanished and actual real-world applications appeared that made effective use of both technologies. I am convinced that Ajax will follow a similar path but will travel it more quickly. A tour of the Web will prove that there are already loads of useful Ajax applications available today.

But back to my reluctance to write an Ajax book. I kept saying that Ajax itself could be explained in 20 to 30 pages. Adding some background information and examples might produce 75 pages, maybe 100. But how could I fill the rest of the book? Many of the Ajax books currently on the market have to go through contortions to reach a reasonable page count.

My thinking about all of this changed when I attended the Microsoft Professional Developers Conference conference in Los Angeles in September 2005 and saw Atlas for the first time. Microsoft was announcing a framework that provided Ajax functionality but added controls and functionality to make development of modern web applications easier. This was something to write about, I thought. I then started working on the manuscript based on the early, prerelease version of Atlas. I had to rewrite it several times with every new prerelease drop of Atlas I could get my hands on. The lack of documentation for the preliminary releases required me to reverse-engineer the inner workings of Atlas, so this book may describe a few unofficial ways to accomplish things.

As of this book's publication, Atlas is not finished; an official release is expected in late 2006 or early 2007. So, while the fundamentals are likely to remain stable, all of the information in this book is subject to change. Atlas is available from Microsoft today under a Go Live license, which means that Microsoft sees the technology as ready for use in building production web sites.

This book will teach you how to create professional, dynamic web pages using the Microsoft Atlas framework. A certain amount of JavaScript and ASP.NET knowledge is required, but the JavaScript basics are covered at the beginning of the book.

I am a big believer in the "show, don't tell" principle. Therefore, this book contains a large number of examples showing you the key aspects of the Atlas framework. I am also a fan of focusing on the relevant facts. So I have created small examples, each conveying one or two points; I deliberately avoided putting as many facts as possible into one very long listing. In my experience as an author and trainer, shorter examples produce better results and make learning easier.

Also, note that the examples are always very generic. This allows you to add them directly to your own projects and modify and tweak them to meet your needs. Every example is self-contained, making it very easy to use and reuse.

Who This Book Is for

This book was written for two groups of web developers: for those who are using ASP.NET and would like to take their applications a step further by using the Ajax technology and for developers who are using another technology but are interested in the Atlas framework. It is also suitable for JavaScript programmers who would like to avoid some of the headaches caused by the necessity of writing cross-browser code. The languages used in this book are C# and JavaScript; if you need background on these languages, O'Reilly has some solid introductions to both.

How This Book Is Organized

Chapter 1, Atlas, Ajax, and ASP.NET, gives a high-level overview of Ajax and the Atlas framework and then covers the installation of Atlas, a review of its structure, and a first simple example.

Chapter 2, JavaScript, is a concise introduction to JavaScript. Although Atlas does its best to hide the details from ASP.NET programmers, a certain knowledge of JavaScript is required to really master Atlas.

Chapter 3, Ajax, explains the technologies beyond the hype. You learn what happens in the background, how Ajax works, and what it really is all about, in fewer than 20 pages.

Chapter 4, Controls, describes the client-side controls that come with Atlas. These make accessing HTML elements from JavaScript easy, using a consistent API.

Chapter 5, Data Binding and Validation, covers how you can perform declarative data binding, meaning that you can program without having to write code. It also features Atlas client-side validation controls.

Chapter 6, Components and Behaviors, shows you the built-in behaviors of Atlas and how to attach their functionality to client-side controls and components.

Chapter 7, Animations, focuses on graphical effects you can implement with Atlas, including opacity animations and automatic positioning of page elements.

Chapter 8, Client Script Library, describes how Atlas enriches the functionality of client-side JavaScript by adding new OOP-like features and even reimplementing some classes of the .NET Framework so that they can be used on the client side.

Chapter 9, Using Server Data, explains how you connect to databases. Atlas can be linked to a data source via specifically crafted web services, making data binding without page refreshes quite easy. Atlas also provides special client-side controls to display data.

Chapter 10, Web Services, deals with XML web services. Even though Atlas focuses on client-based development, it also adds features for server-side web services. This includes features for error management and session support. The chapter also explains how to call remote web services from JavaScript even without using Atlas.

Chapter 11, Extending Controls, focuses on the extender controls in Atlas that do what their name suggests: extending existing controls with capabilities such as autocompletion or drag and drop.

Chapter 12, Virtual Earth, shows how easy it is to use the Virtual Earth API from Atlas. This enables web applications to use map data, dynamically add markers, and more.

Chapter 13, Web Parts and Gadgets, shows to ways to reuse Atlas components: either as a Web Part (with features that regular ASP.NET 2.0 Web Parts do not have), or as a custom Gadget on Microsoft's new Live.com portal.

Chapter 14, Atlas Control Toolkit, introduces the Atlas Control Toolkit and shows how to write custom extender controls. Since the toolkit is now a community-driven project, this is a great opportunity to contribute your own code to Atlas.

Chapter 15, Using Atlas with Other Server Technologies, proves that some parts of the Atlas framework are not tied to ASP.NET 2.0; a sample application in PHP shows how to bridge between these two worlds.

Chapter 16, Other Ajax Tools, concludes the main part of the book by presenting alternative ways to use the Ajax technology with ASP.NET, be it with ASP.NET 1.x or by using ASP.NET 2.0 without Atlas.

Appendix A, XMLHttpRequest Reference, lists important methods and properties of the XMLHttpRequest object.

Appendix B, DOM Reference, covers important JavaScript DOM methods.

Appendix C, Atlas Reference, lists the most important methods provided by the Atlas framework.

Appendix D, ScriptManager and UpdatePanel Declarative Reference, documents the properties of these two key Atlas server control.

What You Need to Use This Book

The examples in this book require only ASP.NET 2.0, which is included in the free redistributable version of the .NET Framework. However, to make the most of ASP.NET and Atlas, you should use one of the IDE offerings from Microsoft. Visual Web Developer 2005 Express Edition (VWD) is free; Visual Studio 2005 (in its various editions) is the commercial package with more features. Both are perfectly suited for using the examples in this book.

Conventions Used in This Book

The following typographical conventions are used in this book:


Plain text

Indicates menu titles, menu options, menu buttons, and keyboard accelerators (such as Alt and Ctrl).


Italic

Indicates new terms, URLs, email addresses, filenames, file extensions, pathnames, directories, and Unix utilities.


Constant width

Indicates commands, options, switches, variables, attributes, keys, functions, types, classes, namespaces, methods, modules, properties, parameters, values, objects, events, event handlers, XML tags, HTML tags, macros, the contents of files, or the output from commands.


Constant width bold

Used to highlight portions of code.


Constant width italic

Shows text that should be replaced with user-supplied values.

This icon signifies a tip, suggestion, or general note.


This icon indicates a warning or caution.


Using Code Examples

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you're reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O'Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product's documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: "Programming Atlas, by Christian Wenz. Copyright 2006 O'Reilly Media, Inc., 978-0-596-52672-6."

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at permissions@oreilly.com.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

O'Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)

We have a web page for this book, where we list errata, code examples, and any additional information. Corresponding files for code examples are mentioned on the first line of the example. You can access this page at:

http://www.oreilly.com/catalog/atlas

To comment or ask technical questions about this book, send email to:

bookquestions@oreilly.com

For more information about our books, conferences, Resource Centers, and the O'Reilly Network, see our web site at:

http://www.oreilly.com

Safari® Enabled

When you see a Safari® Enabled icon on the cover of your favorite technology book, that means the book is available online through the O'Reilly Network Safari Bookshelf.

Safari offers a solution that's better than e-books. It's a virtual library that lets you easily search thousands of top tech books, cut and paste code samples, download chapters, and find quick answers when you need the most accurate, current information. Try it for free at http://safari.oreilly.com.

Acknowledgments

Working on this book turned out to be an enormous task. A lack of documentation, changes from one release to the next, and complicated JavaScript debugging led to a lot of trial and error. Although I had worked with ASP.NET and JavaScript for a very long time, I had to learn Atlas from scratch. Luckily, the Atlas team has been very supportive and open, especially in the public forums at http://forums.asp.net/default.aspx?GroupID=34.

I am grateful to the impressive roster of tech editors who helped me shape this book and provided me with feedback. In alphabetic order, the ones who saved my reputation in a couple of instances are: Adonis Bitar, Arsen Yeremin, Bertrand Le Roy, Christoph Wille, Mike Pope, and Tobias Hauser.

Also, I am indebted to my editor John Osborn who guided me through this project. He is the only editor I know who ever complained when I was submitting material before the negotiated deadline. But it was his excellent project management that allowed me to focus on writing and doing so in due time.

Finally, I have to admit that I am not too keen on personal acknowledgments, thanking family members, husbands/wives/fiancées/partners, and cats/dogs. (The only exception is Richard Hundhausen who once expressed his gratitude that there were no 24-hour divorce services where he lived.) However, I would like to take this opportunity to thank my parents. They were very supportive when I worked my first book, and now, about 50 books later, I finally show some appreciation. Embarrassingly, they sometimes even find mistakes without knowing the technologies involved: some time ago, my father noticed that there were more opening than closing parentheses in a listing. So: thanks Mom, thanks Dad. Andnow that I am into itthanks to my friends and family who do not seem to mind when I have long writing phases or am on the road for yet another conference.




Programming Atlas
Programming Atlas
ISBN: 0596526725
EAN: 2147483647
Year: 2006
Pages: 146

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