The core functionality of ASP.NET AJAX is divided into two parts, the AJAX Extensions and the AJAX Ubrary
ASP.NET AJAX functionality is contained in two assemblies that are installed in the GAC:
- System.wep.Extensions. Design. dll- This assembly contains ASP.NET Designer components for the AJAX Extensions server controls. This is used by the ASP.NET Designer in Visual Studio or Visual Web developer
Much of the AJAX Extensions component of ASP.NET AJAX is concerned with enabling partial-page
postbacks and J50N serialization for Web services. This includes various HTTP handler components and extensions to the existing ASP.NET framework. AIl of this functionality can be configured through the Web.config Ide for a Web site. There are also classes and attributes that you can use for additional configuration. However, most of this configuration is transparent, and you will rarely need to change what is supplied in, for example, the ASP.NET Web Site template .
Your main interaction with AJAX Extensions will be using server controls to add Ajax functionality to yout Web applications. There are several of these, which you can use to enhance your applications in
various ways. The following table shows a selection of the server-side components. You see these components in action later .
ThW control is also responsible for the configuration of Web services that you intend to access from client-side code. By supplying Web service information to the ScriptManager control, you can generate client-side and server-side classes to manage asynchronous communication with Web services transparently.
UpdatePanel: The UpdatePanel control is an extremely useful one and is perhaps the ASP.NET AJAX control that you will use most often. This control acts like a standard ASP.NET placeholder and can contain any other controls. More important, it also marks a section of a page as a region that can be updated independently of the rest of the page, in a partial-page postback.
Any controls contained by an UpdatePanel control that cause a postback (a Button control, for example) will not cause full-page postbacks. Instead, they cause partial-page postbacks that will update only the contents of the UpdatePanel.
In many situations, this control is all you need to implement Ajax functionality. For example, you can place a GridView control in an UpdatePanel control, and any pagination, sorting, and other postback-functionality of the control will take place in a ‘partial-page postback.
UpdateProgress: This control enables you to provide feedback to users when a partial page postback is in progress. You can supply a template for this control that will be displayed when an UpdatePanel is updating. For example, you could use a floating <di v» control to display a message such as “Updating … ” so that the user is aware that the application is busy. Note that partial-page postbacks do not interfere with the rest of a Web page, which will remain responsive.
Timer: The ASP.NETAJAXTimer control is a useful way to cause an UpdatePanel to update periodically. Youcan configure this control to trigger postbacks at regular intervals. If this control is.contained in an UpdatePanel control, then the UpdatePanel will be updated every time the Timer control is triggered. This control also has an associated event so that you can carry out periodic server-side processing.
AsyncPostBackTrigger: You can use this control to trigger UpdatePanel updates from controls that aren’t contained in the UpdatePanel. For example, you can enable a drop-down list elsewhere on a Web page to cause an UpdatePanel containing a GridView control to update.
The AJAXExtensions also include the ExtenderControl abstract base class for extending existing ASP. NET server controls. This is used, for example, by various classes in the ASP.NETAJAXControl Toolkit, as you will see shortly.
Browser compatibility: The lowest-level code in the AJAXLibrary consists of code that maps various
Networking: Classes in the networking layer enable client-side code to call server-side code asynchronously. This layer includes the basic framework for making a call to a URLand responding to the result in a callback function. For the most part, this is also functionality that you will not use directly; instead, you will use classes that wrap this functionality. This layer also contains classes for JSON serialization and deserialization. You will find most of the networking classes on the client-side Sys .Net namespace.
ASP. NET AJAX Control Toolkit
The AJAXControl Toolkit is a collection of additional server controls, including extender controls, that have been written by the ASP.NETAJAXcommunity. Extender controls are controls that-enable you to add functionality to an existing ASP.NETserver control, typically by associating a client-side behavior with it. For example, one of the extenders in the AJAXControl Toolkit extends the TextBox control by placing “watermark” text in the TextBox, which appears when the user hasn’t yet added any content to the text box. This extender control is implemented in a server control called TextBoxWa termark.
You can use the AJAXControl Toolkit to add quite a lot more functionality to your sites, beyond what is in the core download. These controls are also interesting Simply to browse and will probably give you plenty of.ideas about enhancing your Web applications. However, because the AJAXControl Toolkit is separate from the core download, you should not expect the same level of support for these controls.