Book Image

Microsoft AJAX Library Essentials: Client-side ASP.NET AJAX 1.0 Explained

Book Image

Microsoft AJAX Library Essentials: Client-side ASP.NET AJAX 1.0 Explained

Overview of this book

Microsoft AJAX Library Essentials is a practical reference for the client-side library of the ASP.NET AJAX Framework 1.0, and a tutorial for the underlying technologies and techniques required to use the library at its full potential. The main goal of this book is to get you comfortable with the Microsoft AJAX Library, a huge set of functions that can be used for developing powerful client-side functionality.Beginning with a hands-on tour of the basic technologies associated with AJAX, JavaScript, XMLHttpRequest, JSON, and the DOM, you'll move on to a crash course in the Microsoft AJAX tools. You will learn, through numerous step-by-step exercises, how to create basic AJAX applications, how the object-based programming model of JavaScript works, and how Microsoft AJAX Library extends this model. You'll understand the architecture of the Microsoft AJAX components, how they all fit together, and exactly what they can do for you. Then you will learn how to use the Microsoft AJAX Library in your web projects, and a detailed case study will walk you through creating your own customized client components. At every stage of your journey, you'll be able to try out examples to illuminate the theory, and consolidate your understanding. In addition to learning about the client and server controls, you'll also see how to handle errors and debug your AJAX applications.To complement your new found skills, the book ends with a visual reference of the Microsoft AJAX Library namespaces and classes, including diagrams and quick explanations for all the classes mentioned in the book, providing an invaluable reference you will turn to again and again.
Table of Contents (14 chapters)
Copyright
Credits
About the Authors
About the Reviewers
Preface

Sys Namespace


The following members of the Sys namespace are covered here:

  • Sys.Application

  • Sys.ApplicationLoadEventArgs

  • Sys.Browser

  • Sys.CancelEventArgs

  • Sys.Component

  • Sys.CultureInfo

  • Sys.Debug

  • Sys.EventArgs

  • Sys.EventHandlerList

  • Sys.IContainer Interface

  • Sys.IDisposable Interface

  • Sys.INotifyDisposing Interface

  • Sys.INotifyPropertyChange Interface

  • Sys.PropertyChangedEventArgs

  • Sys.ScriptLoader

  • Sys.ScriptLoaderTask

  • Sys.StringBuilder

Sys.Application Class

The Sys.Application object (Figure A-17) object represents the central point for handling client components registered in the application and it is also the one that exposes the main page life cycle events. It works with the Sys.ScriptLoader object to load the scripts in the page.

Figure A-17 Sys.Application

Sys.ApplicationLoadEventArgs Class

Sys.ApplicationLoadEventArgs (Figure A-18) extends Sys.EventArgs and stores the information passed by the load event of Sys.Application.

Figure A-18 Sys.ApplicationLoadEventArgs

Sys.Browser Class

Sys.Browser (Figure A-19) contains contains information based on browser detection and is used throughout the library to solve compatibility issues.

Figure A-19 Sys.Browser

Sys.CancelEventArgs Class

Sys.CancelEventArgs (Figure A-20) extends the Sys.EventArgs class and offers a base class for all the canceled event arguments.

Figure A-20 Sys.CancelEventArgs

Sys.Component Class

Sys.Component (Figure A-21) is the base class for all the components, controls, and behaviors. It is used so that the objects’ lifetime is managed by Microsoft AJAX Library.

Figure A-21 Sys.Component

Sys.CultureInfo Class

Sys.CultureInfo (Figure A-22) represents the base class for objects storing culture-related information.

Figure A-22 Sys.CultureInfo

Based on this class we also have two additional objects:

  • Sys.CultureInfo.InvariantCulture, which is a CultureInfo object having a culture that does not belong to any language or locale. It specifies how dates and numbers should be formatted when the format method is used, thus no specific locale applies

  • Sys.CultureInfo.CurrentCulture, which is also a CultureInfo object having the current culture and thus a specific locale. If no locale is specified, it defaults to en-US and it is used when the localeFormat() method is used.

Sys.Debug Class

Sys.Debug (Figure A-23) provides methods that can be used for debugging and tracing functionality.

Figure A-23 Sys.Debug

Sys.EventArgs Class

Sys.EventArgs (Figure A-24) represents the base class for all the event arguments objects passed by event sources. Sys.EventArgs.Empty represents such an object and is defined in Microsoft AJAX Library.

Figure A-24 Sys.EventArgs

Sys.EventHandlerList Class

Sys.EventHandlerList class (Figure A-25) is used for storing event handlers for different events. The events’ names represent the keys and a list of event handlers the values in an internal dictionary.

Figure A-25 Sys.EventHandlerList

Sys.IContainer Interface

The Sys.IContainer interface (Figure A-26) defines methods for all components that contain other components. It is implemented by Sys.Application.

Figure A-26 Sys.IContainer

Sys.IDisposable Interface

The Sys.INotifyDisposing interface (Figure A-27) represents a common interface for closing and releasing resources held by objects registered using Microsoft AJAX Library.

Figure A-27 Sys.IDisposable

Sys.INotifyDisposing Interface

The Sys.INotifyPropertyChange interface (Figure A-28) defines the disposing event. When implemented, it notifies other objects when it is about to release resources. It is implemented by Sys.Component and thus by all components, behaviors, and controls.

Figure A-28 Sys.INotifyDisposing

Sys.INotifyPropertyChange Interface

The Sys.INotifyPropertyChange interface (Figure A-29) defines the propertyChanged event. It is implemented by Sys.Component and thus by all components, behaviors, and controls.

Figure A-29 Sys.INotifyPropertyChange

Sys.PropertyChangedEventArgs Class

Sys.PropertyChangedEventArgs (Figure A-30) extends Sys.EventArgs class and is used as an event argument by the propertyChanged event.

Figure A-30 Sys.PropertyChangedEventArgs

Sys.ScriptLoader Class

Sys.ScriptLoader (Figure A-31) offers a centralized mechanism for loading script files.

Figure A-31 Sys.ScriptLoader

Sys.ScriptLoaderTask Class

Sys.ScriptLoaderTask (Figure A-32) is used by Sys.ScripLoader to load a particular script file.

Figure A-32 Sys.ScriptLoaderTask

Sys.StringBuilder Class

Sys.StringBuilder class (Figure A-33) offers a mechanism for concatenating strings.

Figure A-33 Sys.StringBuilder