Книга: C# 2008 Programmer

AJAX- Enabling a Page Using the ScriptManager Control

AJAX- Enabling a Page Using the ScriptManager Control

Now let's use some of the core AJAX controls in ASP.NET 3.5 to AJAX-enable the sample project created earlier in this chapter.

The first step toward AJAX-enabling an ASP.NET web page is to add the ScriptManager control to the page. That's the control that manages all the AJAX functionality on your page. It should be placed before any AJAX controls, so it's a good idea to place it at the top of the page, like this:

<body>
 <form runat="server">
  <div>
   <asp:ScriptManager runat="server">
   </asp:ScriptManager>
   Display titles by publisher:
   <asp:DropDownList
    ID="DropDownList1"
    runat="server"
    DataSourceID="LinqDataSource2"
    DataTextField="pub_name"
    DataValueField="pub_id"
    AutoPostBack="True">
   </asp:DropDownList>
   ...

To place the ScriptManager control on the page, you can either type it manually or drag the ScriptManager control from the Toolbox and drop it onto the code editor.

Оглавление книги


Генерация: 1.177. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз