2.9. Summary

ASP.NET AJAX is an outstanding technology that will fundamentally change the approach to Web application development. No longer do you need to completely tear down a page and rebuild it for each and every request. Instead, you are able to rebuild the pages slowly in sections as the end user requests them. The line between the thin-client world and the thick-client world just got a lot more opaque.

ASP.NET AJAX includes the Microsoft AJAX Library that makes writing browser-based JavaScript easier and simplifies many common client programming tasks. It is easy to attach code to DOM events, write JavaScript in an object-oriented way, and access the server for persistent storage, authentication, and updated data.

ASP.NET AJAX also includes extensions to version 2.0 of the .NET Framework that can greatly improve your Web application. There is built-in support for returning data in the JSON format that is easily consumed by JavaScript in the browser.

The UpdatePanel is a simple and flexible control for adding partial page updates to an ASP.NET application. You can take an existing application and identify parts of a page that can be updated independently, bypassing the click-pause-flash pattern that annoys users in Web applications. The ViewState and other hidden fields are updated automatically as part of the ScriptManager's coordination of UpdatePanel controls on the page.

The default behavior is to have every action that would have triggered a postback from a child control of the UpdatePanel cause a partial page update. The children controls are treated as triggers; thus, the ChildrenAsTriggers property is true by default. You can also configure triggers to be events on controls elsewhere on the page.

The PageRequestManager provides a whole lifecycle of events in the browser that allows you to control how asynchronous requests occur. You can cancel requests before they start, abort them while they are in flight, and react to any errors that happen while they are being processed.

As soon as you start initiating asynchronous requests, the need may arise to cancel requests before they start, or abort them before they complete. The PageRequestManager provides events that give you fine-grained control over the asynchronous requests. Moreover, when errors occur during the page request, you can detect them and react accordingly.

The UpdateProgress control makes it easy to let the end user know that an asynchronous request is being processed. Without it, a long-running request can leave users feeling that their actions are being ignored. You can have an UpdateProgress control associated with each UpdatePanel or a single UpdateProgress associated with multiple UpdatePanels.

You can easily update parts of the page out of band, based on the user clicking a button, and you can also update parts of the page automatically. The Timer control makes it simple to define an interval to have parts of the page refreshed without user intervention.

The UpdatePanel and PageRequestManager work together with the help of the ScriptManager to provide a platform for developing a more responsive and intuitive user experience. The extensibility points make it easy to integrate partial page rendering into existing complex applications.

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

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