Installing ASP.NET AJAX

Introduction

This topic describes how to install Microsoft ASP.NET AJAX. It also
describes how to install the optional ASP.NET 2.0 AJAX Futures CTP and
optional ASP.NET AJAX Control Toolkit.

ASP.NET AJAX

ASP.NET AJAX enables you to create dynamic Web pages that support
partial-page updates. It includes Microsoft ASP.NET 2.0 AJAX
Extensions, which is a server framework, and the Microsoft AJAX
Library, which consists of client script that runs on the browser.

note

The installation process installs the ASP.NET AJAX assembly
(System.Web.Extensions.dll) in the global assembly cache (GAC). Do not
include the assembly in the Bin folder of your AJAX-enabled Web site.

You can install and use ASP.NET AJAX with Microsoft Visual Studio 2005
or Microsoft Visual Web Developer Express Edition. However, you do not
require Visual Studio 2005 to use ASP.NET AJAX to create ASP.NET Web
applications.

You can install and use the Microsoft AJAX Library without the .NET
Framework. You can also install it on non-Windows environments to
create client-based Web applications for any browser that supports
ECMAScript (JavaScript).

ASP.NET 2.0 AJAX Futures CTP

The CTP release is community supported. The features in the CTP
release might be added to the supported features in future versions of
ASP.NET AJAX. The CTP release is compatible with ASP.NET AJAX.

ASP.NET AJAX Control Toolkit

The ASP.NET Control Toolkit provides features that extend
functionality of ASP.NET AJAX version 1.0. These features enhance the
depth and breadth of the platform and include new ideas and concepts.
The ASP.NET Control Toolkit is community supported and community
driven.

System Requirements for Installation

Microsoft ASP.NET AJAX requires the following software.

Supported Operating Systems

Windows Server 2003

Windows XP Home Edition

Windows XP Professional

Windows Vista

Any Windows operating system version (including Windows 2000) that
supports the Microsoft .NET Framework version 2.0. Note that support
will be limited to the terms of support for that platform.

Required Software

The .NET Framework 2.0 or version 3.0.

Internet Explorer 5.01 or later.

Optional Software

Microsoft Visual Studio 2005 or Visual Web Developer Express Edition

Installing Microsoft ASP.NET AJAX

Follow these steps to install ASP.NET AJAX.

To install Microsoft ASP.NET AJAX

Make sure that you are logged in with an account that has Administrator rights.

If your account does not have Administrator rights, the installation
process displays the error "The system administrator has set policies
to prevent this installation."

Uninstall any earlier versions of ASP.NET AJAX. If the installation
process finds an earlier version on your computer, it will stop.

You can remove earlier versions with the Add or Remove Programs
application in Control Panel.

Download the ASPAJAXExtSetup.msi installation package from the ASP.NET
AJAX Downloads Web site.

To install ASP.NET AJAX from the Windows interface, double-click
ASPAJAXExtSetup.msi in Windows Explorer.

By default, the .msi file is installed in the following location:

drive:\..\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.nnnn.

To install ASP.NET AJAX from the command line, execute the following
command at a command prompt:

msiexec /i ASPAJAXExtSetup.msi [/q] [/log <log file name>]
[INSTALLDIR=<installation path>]

Specify the /q option to perform the installation without user
prompts. You can optionally provide an installation path and a file
name for logging. If you do not provide an installation path, the
default installation path is used.

If you want to add the ASP.NET 2.0 AJAX Futures CTP, download and
install it from the ASP.NET AJAX Downloads Web site.

If you want to add the ASP.NET AJAX Control Toolkit, download and
install it from ASP.NET AJAX Control Toolkit Web site.

Using ASP.NET AJAX with Visual Studio

If you have Microsoft Visual Studio 2005 installed on your computer,
the installation process installs templates for AJAX-enabled Web site
projects. It also installs an assembly (AJAXExtensionToolbox.dll) that
extends the Visual Studio toolbox. When you create a new AJAX-enabled
Web site by using Microsoft Visual Studio 2005, the template
automatically includes the Web.config file that includes the elements
required for ASP.NET AJAX components.

To add ASP.NET AJAX components to an existing site, modify the
Web.config file in the Web application by using the configuration
values from the sample Web.config file in the installation path. For
more information about ASP.NET AJAX configuration values, see
Configuring ASP.NET AJAX.

Using ASP.NET AJAX Without Visual Studio

If Microsoft .NET Framework version 2.0 is installed on a computer
without Microsoft Visual Studio 2005 or Visual Web Developer Express
Edition, the ASP.NET AJAX installation process adds the
System.Web.Extensions.dll assembly that contains server components to
the global assembly cache. It also copies a sample Web.config file to
the installation path. It does not install templates for AJAX-enabled
Web site projects or install the assembly for extending the Visual
Studio toolbox.

You can use ASP.NET AJAX in a Web application by adding the sample
Web.config file from the installation folder to the Web site
directory. You can also modify the Web.config file in an existing Web
application by using the configuration values from the sample
Web.config file. For more information about the ASP.NET AJAX
configuration values, see Configuring ASP.NET AJAX.

Installing the Microsoft AJAX Library on Non-Windows Environments

You do not have to build a Web site on a Windows-based environment to
use the client framework provided by the Microsoft AJAX Library. The
Microsoft AJAX Library consists of JavaScript files and will work with
any browsers that can run JavaScript code.

note

The Microsoft AJAX Library is installed with the full installation.
You do not have to install the Microsoft AJAX Library separately if
you have completed the full installation.

To install Microsoft AJAX Library

Download the MicrosoftAJAXLibrary.zip package from the ASP.NET AJAX
Downloads Web site.

Unzip the MicrosoftAJAXLibrary.zip package.

Copy the JavaScript files to the Web site.

ASP.NET AJAX Client Life-Cycle Events

Introduction

A Microsoft ASP.NET AJAX page raises the same server life-cycle events as an ASP.NET 2.0 Web page and also raises client life-cycle events. The client events enable you to customize the UI for both postbacks and for asynchronous postbacks (partial-page updates). The client events also help you manage custom script components during the lifetime of the page in the browser.

The client events are raised by classes in the Microsoft AJAX Library. These classes are automatically instantiated when a page contains ASP.NET AJAX server controls. The client classes provide APIs that enable you to bind to events and to provide handlers for those events. Because the Microsoft AJAX Library is browser independent, the code you write for your handlers works the same in all supported browsers.

The key event for initial requests (GET requests) and synchronous postbacks is the load event of the Application instance. When script in a load event handler runs, all scripts and components have been loaded and are available. When partial-page rendering with UpdatePanel controls is enabled, the key client events are the events of the PageRequestManager class. These events enable you to handle many common scenarios. These include the ability to cancel postbacks, to give precedence to one postback over another, and to animate UpdatePanel controls when their content is refreshed.

Client events are useful whether you are creating pages or writing components. If you are a page developer, you can provide custom script that is called when the page loads and unloads in the browser.


Client Classes

The two main Microsoft AJAX Library classes that raise events during the client life cycle of an ASP.NET AJAX Web page are the Application and PageRequestManager classes.

The Application class is instantiated in the browser when the page contains a ScriptManager control. The Application class resembles the Page server control, which derives from the Control class, but provides additional functionality for raising server events. Similarly, the Application class derives from the Sys.Component class, but raises client life-cycle events that you can handle.

If a page contains a ScriptManager control and one or more UpdatePanel controls, the page can perform partial-page updates (if partial-page rendering is enabled and supported in the browser). In that case, an instance of the PageRequestManager class is automatically available in the browser. The PageRequestManager class raises client events that are specific to asynchronous postbacks. For details about partial-page rendering, see Partial-Page Rendering Overview.

Adding Handlers for Client Events

To add or remove handlers for events raised by the Application and PageRequestManager classes, use the add_eventname and remove_eventname methods of those classes. The following example shows how to add a handler named MyLoad to the init event of the Application object.

CS

Sys.Application.add_init(MyInit);
function MyInit(sender) {
}
Sys.Appplication.remove_init(MyInit);

VB

Sys.Application.add_init(MyInit);
function MyInit(sender) {
}
Sys.Appplication.remove_init(MyInit);

note

This example shows just the syntax of the add_eventname and remove_eventname methods. Details about what you can do with specific events are provided later in this topic.

Handling the Application Load and Unload Events

To handle the load and unload events of the Application object, you do not have to explicitly bind a handler to the event. Instead, you can create functions that use the reserved names pageLoad and pageUnload. The following example shows how to add a handler for the load event of the Application object by using this approach.

CS

function pageLoad(sender, args) {
}

VB

function pageLoad(sender, args) {
}

Events for Other Client Classes

This topic describes only the events that are raised by the Application and PageRequestManager classes. The Microsoft AJAX Library also contains classes for adding, clearing, and removing handlers for DOM element events. These classes include the following:

  • The Sys.UI.DomEvent.addHandler method or the shortcut $addHandler.

  • The Sys.UI.DomEvent.clearHandlers method or the shortcut $clearHandlers.

  • The Sys.UI.DomEvent.removeHandler method or the shortcut $removeHandler.

Events raised by DOM elements are not discussed in this topic.

Client Events of the Application and PageRequestManager Classes

The following table lists client events of the Application and PageRequestManager classes that you can handle in AJAX ASP.NET-enabled pages. The order in which the events are raised is described later in this topic.

Event

Description

init Event

Raised after all scripts have been loaded but before any objects are created. If you are writing a component, the init event gives you a point in the life cycle to add your component to the page. The component can then be used by other components or by script later in the page life cycle. If you are a page developer, you should use the load event instead of the init event for most scenarios.

The init event is raised only one time when the page is first rendered. Subsequent partial-page updates do not raise the init event.

load Event

Raised after all scripts have been loaded and all objects in the application that are created by using $create are initialized. The load event is raised for all postbacks to the server, which includes asynchronous postbacks.

If you are a page developer, you can create a function that has the name pageLoad, which automatically provides a handler for the load event. The pageLoad handler is called after any handlers that have been added to the load event by the add_load method.

The load event takes an eventargs parameter, which is an Sys.ApplicationLoadEventArgs object. You can use the event arguments to determine whether the page is being refreshed as a result of a partial-page update and what components were created since the previous load event was raised.

unload Event

Raised before all objects are disposed and before the browser window's window.unload event occurs.

If you are a page developer, you can create a function that has the name pageUnload, which automatically provides a handler for the unload event. The pageUnload event is called just before the page is unloaded from the browser. During this event, you should free any resources that your code is holding.

propertyChanged Event

Potentially raised when a property of a component changes. The Application object inherits this event from the Component class. This event is raised only if a component developer has called the Sys.Component.raisePropertyChange method in a property set accessor. For more information, see Defining Custom Component Properties and Raising PropertyChanged Events.

The propertyChanged event takes an eventargs parameter, which is a Sys.applicationLoadEventArgs object.

disposing Event

Raised when the Application instance is disposed. The Application object inherits this event from the Component class.

initializeRequest Event

Raised before an asynchronous request starts. You can use this event to cancel a postback, such as to give precedence to another asynchronous postback.

The initializeRequest event takes an eventargs parameter, which is a Sys.WebForms.InitializeRequestEventArgs object. This object makes available the element that caused the postback and the underlying request object. InitializeRequestEventArgs also exposes a cancel property. If you set cancel to true, the new postback is canceled.

beginRequest Event

Raised before an asynchronous postback starts and the postback is sent to the server. If there is a postback already processing, it is stopped (by using the abortPostBack method). You can use this event to set request headers or to begin an animation on the page to indicate that the request is in process.

The beginRequest event takes an eventargs parameter, which is a Sys.WebForms.BeginRequestEventArgs object. This object makes available the element that caused the postback and the underlying request object.

pageLoading Event

Raised after the response from the server to an asynchronous postback is received, but before any content on the page is updated. You can use this event to provide a custom transition effect for updated content.

The pageLoading event takes an eventargs parameter, which is an Sys.WebForms.PageLoadingEventArgs object. This object makes available information about what panels will be deleted and updated as a result of the most recent asynchronous postback.

pageLoaded Event

Raised after all content on the page is refreshed, as a result of either a synchronous or an asynchronous postback. For synchronous postbacks, panels can only be created, but for asynchronous postbacks, panels can be both created and updated. You can use this event to manage a custom transition effect for updated content.

The pageLoaded event takes an eventargs parameter, which is an Sys.WebForms.PageLoadedEventArgs object. This object makes available information about which panels were updated and created in the most recent postback.

endRequest Event

Raised after the response for an asynchronous postback is processed and the page is updated, or during the processing of the response if there is an error. If an error occurs, the page is not updated. Use this event to provide customized error notification to users or to log errors.

The endRequest event takes an eventargs parameter, which is a Sys.WebForms.EndRequestEventArgs object. This object makes available information about errors that have occurred and whether the error was handled. It also makes available the response object.

Browser Compatibility and Security Settings for AJAX-Enabled ASP.NET Sites

Introduction

ASP.NET AJAX is compatible with most modern browsers. It runs with the default security settings for these browsers.

Browser and Operating System Compatibility

Users can view your AJAX-enabled ASP.NET sites by using most modern browsers. The following lists show compatible browser versions and operating systems.

Supported Browsers

  • Microsoft Internet Explorer 6.0 or later versions.

  • Mozilla Firefox version 1.5 or later versions.

  • Opera version 9.0 or later versions.

  • Apple Safari version 2.0 or later versions.

Supported Operating Systems

  • Microsoft Windows XP with Service Pack 2 installed.

  • Microsoft Vista.

  • Apple OSX (Intel architecture only).

Security and Privacy Settings

The following table lists required browser security and privacy settings for both user browsing and site development. In all cases, the recommended settings are the default settings for that browser.

Internet Explorer 6

Make sure that the Internet Zone in the Security Zones settings is set to Medium.

Internet Explorer 7

Make sure that the Internet Zone in the Security Zones settings is set to Medium-High.

FireFox 1.5 or later versions

In the Tools menu under Options, make sure that Enable JavaScript is selected.

Opera 9.0 or later versions

In the Tools menu under Quick preferences, make sure that Enable JavaScript is selected.

Safari 2.0 or later versions

Click Safari, Preferences, Security, and then Web Content and make sure that Enable JavaScript is selected.

Configuring ASP.NET AJAX

Introduction

This topic describes the elements in the Web.config file that support Microsoft ASP.NET AJAX. It also describes how to incorporate those elements into the Web.config file for an existing ASP.NET application.

Using the ASP.NET AJAX Web Configuration File in a New Web Site

When you create a new AJAX-enabled Web site, you can use the Web.config file provided in the installation package to add the required configuration settings. In Visual Studio, the Web.config file for Microsoft ASP.NET AJAX is included in your project when you create a new ASP.NET AJAX-enabled Web Site.

If you have to manually add the Web.config file to a new Web site, you can get a copy of it from the installation path. By default, the file is in the following location:

drive:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.nnnn

Adding ASP.NET AJAX Configuration Elements to an Existing Web Site

In an existing Web site, you typically have values in the Web.config file that you want to retain. In that case, you can add the new ASP.NET AJAX elements into the existing Web.config file. 

The new elements are part of the following configuration sections:

  • The <configSections> element

  • The <controls> element

  • The <assemblies> element

  • The <httpHandlers> element

  • The <httpModules> element

  • The <system.web.extensions> element

  • The <system.webserver> element

The <configSections> Element

The <configSections> element creates a configuration section and subsections for the SystemWebExtensionsSectionGroup class. You set the properties for these sections in the <system.web.extensions> element.

The following example shows the <configSections> element for ASP.NET AJAX. Add this section to the existing Web.config file as a child of the <configuration> element.

<configuration>
<configSections>
<sectionGroup name="system.web.extensions"
type="System.Web.Configuration.SystemWebExtensionsSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting"
type="System.Web.Configuration.ScriptingSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler"
type="System.Web.Configuration.ScriptingScriptResourceHandlerSection,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false"
allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices"
type="System.Web.Configuration.ScriptingWebServicesSectionGroup,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization"
type="System.Web.Configuration.ScriptingJsonSerializationSection,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService"
type="System.Web.Configuration.ScriptingProfileServiceSection,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false"
allowDefinition="MachineToApplication" />
<section name="authenticationService"
type="System.Web.Configuration.ScriptingAuthenticationServiceSection,
System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false"
allowDefinition="MachineToApplication" />
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
</configuration>

The <controls> Element

The <controls> element registers ASP.NET AJAX namespaces in the System.Web.Extensions assembly and maps the asp tag prefix as an alias for these namespaces. The controls in the ASP.NET AJAX namespaces can be referenced in a Web page with syntax such as the following:

<asp:ScriptManager ID="ScriptManager1" runat="server" />

The following example shows the <controls> element for ASP.NET AJAX. Add this section to the existing Web.config file as a child of the <system.web><pages> element.

<system.web>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
</system.web>

The <assemblies> Element

The <assemblies> element registers the System.Web.Extensions assembly.

The following example shows the <assemblies> element for ASP.NET AJAX. Add this section to the existing Web.config file as a child of the <system.web><compilation> element.

<system.web>
<compilation>
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>
</system.web>

The <httpHandlers> Element

The <httpHandlers> element adds new handlers for script requests.

The following example shows the <httpHandler> element for ASP.NET AJAX. Add this section to the existing Web.config file as a child of the <system.web> element.

<system.web>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
</system.web>

The <httpModules> Element

The <httpModules> element defines HTTP modules used in ASP.NET AJAX.

The following example shows the <httpModules> element for ASP.NET AJAX. Add this section to the existing Web.config file as a child of the <system.web> element.

<system.web>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
</system.web>

The <system.web.extensions> Element

The <system.web.extensions> element provides elements that can be uncommented to configure how Web services are called from Microsoft ASP.NET AJAX applications. The <jsonSerialization> element is used to specify custom type converters and to override default settings for JSON serialization. The <converters> element specifies custom type converters. The <authenticationService> element is used to enable or disable the authentication service. The <profileService> element is used to enable or disable the profile service and to specify which properties are exposed by the service. The <scriptResourceHandler> element is used to enable or disable caching and compression of resources used with scripts.

The <scriptResourceHandler> element, <authenticationService> element, and <profileService> element can be defined only in the Machine.config file or in the Web.config file in the application root directory. The <jsonSerialization> element can be defined in the Machine.config file, in the Web.config file in the application root directory, or in a Web.config file in a subfolder of the Web site.

The following example shows the <system.web.extensions> element for ASP.NET AJAX. Add this section and its subsections to the existing Web.config file as a child of the <configuration> element.

<system.web.extensions>
<scripting>
<webServices>
<!-- Uncomment this line to customize maxJsonLength and add a
custom converter -->
<!--
<jsonSerialization maxJsonLength="500">
<converters>
<add name="ConvertMe"
type="Acme.SubAcme.ConvertMeTypeConverter"/>
</converters>
</jsonSerialization>
-->
<!-- Uncomment this line to enable the authentication service.
Include requireSSL="true" if appropriate. -->
<!--
<authenticationService enabled="true" requireSSL = "true|false"/>
-->

<!-- Uncomment these lines to enable the profile service. To
allow profile properties to be retrieved
and modified in ASP.NET AJAX applications, you need to add
each property name to the readAccessProperties and
writeAccessProperties attributes. -->
<!--
<profileService enabled="true"
readAccessProperties="propertyname1,propertyname2"
writeAccessProperties="propertyname1,propertyname2" />
-->
</webServices>
<!--
<scriptResourceHandler enableCompression="true"
enableCaching="true" />
-->
</scripting>
</system.web.extensions>

The <system.webserver> Element

The <system.webserver> element contains configuration settings used by Microsoft Internet Information Server (IIS) 7.0.

The following example shows the <system.webserver> element for ASP.NET AJAX. Add this section to the existing Web.config file as a child of the <configuration> element.

<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<add name="ScriptModule"
preCondition="integratedMode"
type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-ISAPI-2.0"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx"
preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*"
path="*_AppService.axd" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptResource" preCondition="integratedMode"
verb="GET,HEAD" path="ScriptResource.axd"
type="System.Web.Handlers.ScriptResourceHandler,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
</handlers>
</system.webServer>

Explain ASP.NET AJAX Client Architecture

The ASP.NET AJAX client-script libraries consist of JavaScript (.js) files that provide features for object-oriented development. The object-oriented features included in the ASP.NET AJAX client-script libraries enable a high level of consistency and modularity in client scripting. The following layers are included in the ASP.NET AJAX script libraries:

  • A browser compatibility layer. This provides compatibility across the most frequently used browsers (including Microsoft Internet Explorer, Mozilla Firefox, and Apple Safari) for your ASP.NET AJAX scripts.

  • ASP.NET AJAX core services, which include extensions to JavaScript, such as classes, namespaces, event handling, inheritance, data types, and object serialization.

  • An ASP.NET AJAX base class library, which includes components such as string builders and extended error handling.

  • A networking layer that handles communication with Web-based services and applications, and that manages asynchronous remote method calls.

  • Support for JavaScript libraries that are either embedded in an assembly or are provided as standalone JavaScript (.js) files. Embedding JavaScript libraries in an assembly can make it easier to deploy applications and can solve versioning issues.

  • Support for accessing server-based forms authentication and profile information in client script. This support is also available to Web applications that are not created by using ASP.NET, as long as the application has access to the Microsoft AJAX Library.

  • Support for release and debug modes and localization support for both assembly-embedded and standalone JavaScript files

What are ASP.NET AJAX Server Controls?

The ASP.NET AJAX server controls consist of server and client code that integrate to produce AJAX-like behavior. The following list describes the most frequently used ASP.NET AJAX server controls.

ScriptManager

Manages script resources for client components, partial-page rendering, localization, globalization, and custom user scripts. The ScriptManager control is required in order to use the UpdatePanel, UpdateProgress, and Timer controls.

UpdatePanel

Enables you to refresh selected parts of the page, instead of refreshing the whole page by using a synchronous postback.

UpdateProgress

Provides status information about partial-page updates in UpdatePanel controls.

Timer

Performs postbacks at defined intervals. You can use the Timer control to post the whole page, or use it together with the UpdatePanel control to perform partial-page updates at a defined interval.

Why Use ASP.NET AJAX?

ASP.NET AJAX enables you to build rich Web applications that have many advantages over Web applications that are completely server-based. ASP.NET AJAX applications offer:
  • Improved efficiency by performing significant parts of a Web page's processing in the browser.

  • Familiar UI elements such as progress indicators, tooltips, and pop-up windows.

  • Partial-page updates that refresh only the parts of the Web page that have changed.

  • Client integration with ASP.NET application services for forms authentication and user profiles.

  • Integration of data from different sources through calls to Web services.

  • A framework that simplifies customization of server controls to include client capabilities.

  • Support for the most popular and generally used browsers, which includes Microsoft Internet Explorer, Mozilla Firefox, and Apple Safari.