14.2. The AJAX Client Library

While the server components of the AJAX Extensions are limited to use with ASP.NET, a good portion of the client components can be used with any web site regardless of the application server. With this having been said, ASP.NET developers have easier access to the client tools via Visual Studio.

14.2.1. Accessing the Client Tools with ASP.NET

Ironically, the simplest way to access the client tools with ASP.NET is to use the new server controls that come with the Extensions. To begin, you'll need an Ajax-enabled ASP.NET web site.

Open Visual Web Dev, and pull up the New Web Site dialog (see Figure 14-1) by going to the File menu and choosing New Web Site.

The AJAX Extensions CTP installs two new templates: ASP.NET AJAX-Enabled Web Site and ASP.NET AJAX CTP-Enabled Web Site; choose the second option and press OK. When Visual Studio creates and opens the project, the source code for the Default.aspx file is opened. It consists of the Page declaration at the top of the file, followed by the HTML's doctype, head, and body.

Figure 14.1. Figure 14-1

Inside the page's body is a server control:

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

The ScriptManager control manages the JavaScript components, partial-page rendering, and HTTP requests/responses for ASP.NET Ajax pages. In short, this control adds the core JavaScript files to the web page. ...

Get Professional Ajax, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.