One of the most interesting characteristics of ASP.NET AJAX is that the client half (the Microsoft AJAX Library) is full of features not exposed by the server half (the ASP.NET 2.0 AJAX Extensions). A case in point is drag-drop. The DragOverlayExtender control in the ASP.NET AJAX Futures CTP makes it extremely easy to convert static HTML elements into floating elements. However, DragOverlayExtender is next to useless in the real world, because it offers no control over when and where drops occur or other essential drag-drop semantics.
Ironically, the Microsoft AJAX Library contains support for rich, interactive drag-drop operations. The model that it uses is patterned after the old OLE drag-drop model, in which drag sources implement the IDragSource interface, drop targets implement the IDropTarget interface, and the system provides a drag-drop manager to connect drag sources to drop targets. In ASP.NET AJAX, the drag-drop manager is an instance of a class named Sys.Preview.UI._DragDropManager, which is automatically instantiated and made available through a global variable named Sys.Preview.UI.DragDropManager. The problem with DragOverlayExtender is that it’s little more than a wrapper around Sys.Preview.UI.FloatingBehavior, which in turn uses DragDropManager but exploits only a fraction of its capabilities.
A better example of the kinds of drag-drop scenarios that DragDropManager enables is found in the ASP.NET AJAX Control Toolkit. The ReorderList control uses what is essentially a copy of DragDropManager to implement a list whose items can be rearranged using drag-drop. (It uses a toolkit-specific version of DragDropManager rather than the one in the Futures CTP so the toolkit can be used without the CTP.)
If you happen to be in London next week for DevWeek, I’ll be presenting my custom drag-drop sample and walking through the code in Monday’s ASP.NET AJAX workshop.