Microsoft Developer Network (MSDN)

ASP.NET AJAX

ASP.NET AJAX provides a framework for building rich, interactive user interfaces for your ASP.NET Web Forms applications. It enables you to create dynamic pages that update portions of the page without requiring a full postback to the server, leading to a more responsive and desktop-like user experience.

Key Features and Concepts

Getting Started with ASP.NET AJAX

To enable ASP.NET AJAX in your Web Forms application, you typically need to add a ScriptManager control to your page:

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

Then, you can wrap the content you want to update asynchronously within an UpdatePanel:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <!-- Content to be updated -->
        <asp:Label ID="lblMessage" runat="server" Text="Initial content." />
        <asp:Button ID="btnUpdate" runat="server" Text="Update Content" OnClick="btnUpdate_Click" />
    </ContentTemplate>
</asp:UpdatePanel>

In your server-side code-behind (e.g., Default.aspx.cs):

protected void btnUpdate_Click(object sender, EventArgs e)
{
    lblMessage.Text = "Content updated at: " + DateTime.Now.ToString();
}
Tip: Using UpdatePanel is a straightforward way to achieve AJAX behavior without writing extensive JavaScript.

Advanced Topics

Resources

Note: While ASP.NET AJAX is powerful, consider modern alternatives like ASP.NET Core with JavaScript frameworks (React, Angular, Vue) for new development due to evolving web technologies. However, understanding ASP.NET AJAX is crucial for maintaining and enhancing existing ASP.NET Web Forms applications.