New features in ASP.NET AJAX 4.0
This post is about the session called ASP.NET AJAX 4.0 given by Fritz Onion
A preview of the new version of ASP.NET AJAX is avaible on codeplex since the 28th of May. And it can be used within Visual Studio 2008.
This version mainly focuses on new client side features, some of these are be discussed below.
Live data binding
Gives the developer an easy way to bind multiple controls to a single datasource, if a value changes all controls are automatically updated client side.
Observer pattern
This provides observer functionality to ordinary JavaScript objects, when a change occurs for an observed object a notification is caused, which can be handled accordingly
Client templates
In an asp.net web application a list of data can be shown using a Repeater control, which is server sided. In 4.0 this can be done client sided as well. The way to define this is by using a XHTML compliant template, as shown below.
<table id="resultTable" class="sys-template">
<tr>
<td>{{Name}}</td>
<td>{{Id}}</td>
</tr>
</table>
This type of databinding notation is similar to Silverlight/WPF.
Inclusion of and support for jQuery library
The development team at Microsoft has acknowledged the use of the jQuery library and it will be included in the next release
Web service invocation
It is now easy to invoke a method of a WCF service. A downside is that the service must support JSON serialization and AJAX proxy generation, by default this is possible with WCF services.
Some nice new features the development team is working on are:
- Client sided sorting, pagination and filtering
- Sending changes to the server
- AJAX Control Toolkit will get rolled into the core release (previously this was a separate download)