ASP.NET AJAX, mostly called AJAX, is a set of extensions of ASP.NET. It is developed by Microsoft to implement AJAX functionalities in Web applications. ASP.NET AJAX provides a set of components that enable the developers to develop applications that can update only a specified portion of data without refreshing the entire page. The ASP.NET AJAX works with the AJAX Library that uses object-oriented programming (OOP) to develop rich Web applications that communicate with the server using asynchronous postback.
The difference between synchronous and asynchronous postback is as follows:
- Asynchronous postback renders only the required part of the page; whereas, synchronous postback renders the entire page for any postback.
- Asynchronous postback executes only one postback at a time, that is, if you have two buttons doing asynchronous postback, the actions will be performed one by one; whereas, synchronous postback executes all the actions at once.
- Asynchronous postback only modifies the update panel that raises the postback; whereas, synchronous postback modifies the entire page.
- Imperative syntax - Supports simple imperative syntax that is used to create and manage controls.
- Script loader - Retrieves all scripts that are needed by one or more client component or control automatically and executes the scripts in the order in which they are received.
- Client data access - Supports to access client data and display by client data control and client template.
- Client datacontext - Supports read and write permission to data from a database.
- The AdoNetDataContext class - Enables you to easily interact with an ADO.NET Data Services service.
- jQuery integration - Helps to access the elements in your Web pages, work with client-side events, enable visual effects, and make it easier to use AJAX in your applications.
AJAX uses four technologies, which are as follows:
XMLHttpRequest get the current state of the request operation by using the readyState property. This property checks the state of the object to determine if any action should be taken. The readyState property uses numeric values to represent the state.
ASP.NET AJAX includes the following controls:
The Step property sets the steps for numeric increment and decrement. The default value is 1.
ASP.NET 4.0 AJAX includes several new features that provide more functionality to a user. These features are as follows:
- Support for live data binding.
- Support for client-side template rendering.
- Support for declarative instantiation of client components.
- Support for invoking ADO.NET data services and data contexts.
- Support for the DataView control.
The UpdateProgress control is somewhat related to the UpdatePanel control. The UpdateProgress control enables you to design a user-friendly interface when a Web page consists of a number of UpdatePanel controls for partial-page rendering.
The UpdateProgress control makes you aware of the status information about the partial-page updates in the UpdatePanel control.
The following validation controls are available in ASP.NET AJAX 4.0:
- FilteredTextBoxExtender - Enables you to apply filtering to a text box.
- MaskedEditExtender and MaskedEditValidator - Restricts a user to enter only a certain pattern of characters in the TextBox by applying a mask to the input.
- ValidatorCalloutExtender - Attaches to the ASP.NET validators so that the error messages are not displayed as a simple text but as a balloon-style ToolTip.
- NoBot - Prevents the spam/bot from filling the input forms automatically and uses the Completely Automated Public Turing test to tell Computers and Humans Apart (CAPTCHA), which is a type of challenge-response test to ensure that the response is not generated by the computer.
- PasswordStrengthExtender - Measures the strength of the password text entered within the text box by validating with the different strength specified parameters