11.3. AJAX Toolkit Integration

The AJAX toolkit controls are now combined into the AJAX libraries. Apart from easier deployment, this feature also allows you to programmatically create them. The following example shows how to add the color picker control from the toolkit to a text box programmatically (note how it wasn't necessary to reference any toolkit assemblies):

<script src="./Scripts/Start.js" type="text/javascript"></script>
<script src="./Scripts/Extended/ExtendedControls.js" type="text/javascript" type="text/javascript"></script>

<script>
   Sys.require(Sys.components.colorPicker, function() {
   Sys.create.colorPicker("#txtChooseColor");
   });
</script>

<input id="txtChooseColor" />

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.