4.7. The Sys Namespace

You have already seen some use of the Sys namespace through examples in this chapter such as the previous Sys.Browser example. The Sys namespace is the root namespace within ASP.NET AJAX and a lot of classes and interfaces there are available for use within your JavaScript code.

Microsoft has extended upon the JavaScript library to provide you with the extra items that you are most likely going to want to work with when coding your ASP.NET AJAX pages. These extensions are similar to what you are used to in working with the .NET Framework.

The following table details the available objects found in the Sys namespace.

Object in Sys namespaceDescription
Sys.ApplicationManages client components that are registered with the application
Sys.ApplicationLoadEventArgsHolds event arguments for the load event of the Application class
Sys.CancelEventArgsProvides a means to cancel events
Sys.ComponentProvides the base class for the Control and Behavior classes, and for any other object whose lifetime should be managed by Microsoft ASP.NET AJAX
Sys.CultureInfoLike the CultureInfo object in the .NET Framework, this holds culture related settings
Sys.DebugProvides tracing and debugging information
Sys.EventArgsAllows for passing of event argument information
Sys.EventHandlerListProvides a collection of client events for a component
Sys.IContainerAn interface that provides a common interface for all components that can contain other components
Sys.IDisposableAn interface that allows you to close, reset, or release resources
Sys.INotifyDisposingAn interface that provides notifications of disposing events
Sys.INotifyPropertyChangeAn interface that provides notification of property changes
Sys.PropertyChangedEventArgsUsed by the propertyChanged event to signify which property changed
Sys.ResProvides static, culture-neutral exception messages that are used by the Microsoft AJAX Library framework
Sys.StringBuilderProvides the ability to perform string concatenation
Sys ExceptionsRaises an Error Object; these are exceptions raised by ASP.NET AJAX

Besides the root Sys namespace. You will also find Sys.Net, Sys.Serialization, Sys.Services, Sys.WebForms, and Sys.UI.

  • Sys.Net allows you to make Web service calls, work with the WebRequest object, work with Web service errors, and provides you with XMLHttp support.

  • Sys.Serialization helps you take care of the serialization and deserialization of JSON formatted data.

  • Sys.Services allows you to work with the ASP.NET services such as the ASP.NET membership and role management systems that were introduced with ASP.NET 2.0.

  • Sys.WebForms lets you deal with the loading and unloading of ASP.NET pages. Finally, Sys.UI allows you to deal with things occurring with the page's UI, such as where the mouse is located on the page, how to deal with keys being pressed, or dealing with the DOM.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset