This article does not cite any sources. (July 2016) (Learn how and when to remove this template message)
|Operating system||Microsoft Windows, Linux, macOS|
|License||Microsoft Public License|
Clients supporting Ajax
ASP.NET AJAX runs on the following browsers:
- Microsoft Internet Explorer (>= 6.0)
- Mozilla Firefox (>= 1.5)
- Opera (>= 9.0)
- Apple Safari (>= 2.0)
- Google Chrome (>= 5)
ASP.NET AJAX Suite
At present, the ASP.NET AJAX suite consists of the following components and packages:
- Microsoft Now Launched Ajax Library 4.0, which supports Data Driven Web Applications.
- A server framework – included in ASP.NET 3.5 – for building Ajax-enabled ASP.NET server controls. These components are also available for ASP.NET 2.0 in a separate package called ASP.NET AJAX 1.0 Extensions.
- ASP.NET 2.0 AJAX Templates, a package with a set of Visual Studio templates for building ASP.NET AJAX applications with ASP.NET 2.0 and Visual Studio 2008.
- ASP.NET AJAX Preview, a package with the new features that will be part of the future versions of the framework.
Microsoft Ajax Library
- Abstraction API – Common operations on the DOM (retrieving elements, setting styles and other manipulations) are automatically translated by the library into browser-specific calls.
- Ajax – A set of client components is provided to handle Ajax requests and web-service calls.
- Application Services – The library allows accessing the ASP.NET Membership, Authentication, Roles and Profile services from the client side.
Recently, new features have been announced as part of the ASP.NET AJAX 4.0 release:
- Template Engine – Allows displaying data on the client side by using HTML templates and a custom binding notation. This approach avoids performing page rendering on the server side.
- Live Bindings – Synchronize "element properties".
The UpdatePanel Control
The UpdatePanel is an ASP.NET server control that updates portions of a web page without reloading it. Through a mechanism called asynchronous postback, the HTML for the region of the page wrapped by the control is sent by the server asynchronously through an Ajax request. The ASP.NET controls that have been specified as content in an UpdatePanel are able to cause either synchronous (traditional) or asynchronous postbacks, by means of triggers.
A trigger is an event coming from an ASP.NET control that causes an UpdatePanel to refresh its contents. Through triggers, an asynchronous postback can be started also by controls that are declared outside the region of the ASP.NET page wrapped by the UpdatePanel control.
In the following code, only the content of the Update control (the span element that displays the current date and time) is re-rendered every time the button is clicked.
<asp:Button ID="Button1" runat="server" Text="Refresh" /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <Triggers> <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" /> </Triggers> <ContentTemplate> <span><%= DateTime.Now %></span> </ContentTemplate> </asp:UpdatePanel>
Web-services and JSON