11.4. Controls Now Exposed As jQuery Plug-Ins

In this release, all the ASP.NET AJAX controls are exposed as jQuery plug-ins. So, you can instantiate them using jQuery syntax, even using jQuery's chaining capabilities. The following code attaches an ASP.NET AJAX watermark control to a text box and an ASP.NET AJAX color picker:

Sys.require([Sys.scripts.jQuery, Sys.components.watermark, Sys.components.colorPicker]);
   Sys.onReady(function () {
   $("#txtChooseColor").watermark("Choose a color", "watermarked").colorPicker();
});

Get Introducing .NET 4.0: with Visual Studio 2010 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.