Introduction


ASP.NET AJAX is the newest addition to ASP.NET 2.0 and is a supported Microsoft framework for next-generation Web development using AJAX technologies. AJAX is shorthand for “Asynchronous JavaScript + XML,” an approach to Web applications that utilizes asynchronous data requests from the page with a client-side JavaScript engine. It is not one technology, but rather a combination of technologies that enables rich-client responsiveness in the browser when used together. It’s also not a new technology, but rather a new trend that combines old technologies in a new way. The technologies include object-oriented JavaScript, asynchronous data requests utilizing the XMLHttpRequest object, XML data streams, Extensible Stylesheet Language Transformation (XSLT) transforms, and dynamic manipulation of the HTML Document Object Model (DOM). It more closely resembles a recipe for Web applications than a single architecture-it is an approach to Web applications based on rendering and manipulating data in smaller components during the page’s life cycle in response to user actions on the client rather than the processing of the entire page as a whole. Because of this design pattern, Web Parts make an excellent deployment mechanism for AJAX components in Microsoft Windows SharePoint Services (WSS), and many of the built-in WSS APIs can be leveraged in JavaScript code from the browser.

The main benefit of using AJAX techniques in Web applications is an increased level of responsiveness once possible only in rich-client applications. Instead of waiting for a page reload or form post to update the user interface, the browser can send a discrete call to the server by using the XmlHttpRequest object while enabling the user to continue working.

A callback method on the client is then used to handle the Web request when it is completed. Compared to traditional applications, AJAX applications typically make smaller and more frequent data requests, loading data as needed rather than performing large data transfers up front. Figure 5-1 displays the traditional WSS page life cycle, in which the entire page is reprocessed as the user interacts with the data. In this traditional model, the page is requested and sent to the client as a whole. Upon page refresh, all required data must be reprocessed and resent, making data manipulations and navigation a disruptive activity. If multiple Web Parts exist on the page, each Web Part must be refreshed during the page request/response cycle. There is also significant overhead in the WSS page itself that would ideally be processed only once per user context rather than on each user interaction.

image from book
Figure 5-1: The traditional WSS Web page life cycle

In contrast to the traditional processing model, the AJAX approach to WSS programming includes a client runtime based on the ASP.NET AJAX Library, custom controller components patterned after the Model View Controller design pattern, and service-oriented XML data sources. Figure 5-2 illustrates the dynamic nature of the AJAX approach. Instead of one fat data stream being processed in the main request/response, individual components are responsible for their processing and can be individually refreshed and updated in response to user actions, events, or timer components. The user interface and data streams could also evolve over the client life cycle of the page-new components can be spawned from additional data sources and loaded into new components, all without reloading or posting the Web page. The Web page life cycle is much longer in an AJAX application because the page is not refreshed after the initial page load.

image from book
Figure 5-2: The AJAX WSS Web page life cycle

Utilizing the ASP.NET AJAX Framework in WSS and Microsoft Office SharePoint Server allows you to take advantage of AJAX technologies and methods while using a tested and supported framework that is fully integrated with ASP.NET 2.0. Before we learn how to deploy AJAX components in Web Parts, we will first look at AJAX architecture patterns and examine an AJAX application outside of the WSS context.




Inside Microsoft Windows Sharepoint Services Version 3
Inside Microsoft Windows Sharepoint Services Version 3
ISBN: 735623201
EAN: N/A
Year: 2007
Pages: 92

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