Hidden away inside the PreviewDragDrop.js file supplied by the ASP.NET AJAX Futures Community Technology Preview (CTP) lies support for rich, browser-based drag-and-drop user interfaces. The model 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 the January issue of MSDN Magazine, Jeff Prosise explains how you can use PreviewDragDrop.js to implement real drag and drop support in a Web app, including custom drag sourcing and custom drop targeting.

Once you're familiar with the model (and comfortable with the concept of deriving classes and implementing interfaces in JavaScript), DragDropManager opens up a whole new world of possibilities for Web UIs.

Don't forget to browse the code in our online code library, and check out past installments of Wicked Code in the archives.

 

Technorati Tags: ,