Drag-drop in ASP.NET: any prior art?
It has been possible for a few years now to include drag-drop functionality in browser-based applications. It is still tricky to make it work cross-platform (meaning IE & FireFox & Safari to me), but libraries to help do this are freely available as well. I personally like the X library from cross-browser.com (drag-drop example).
When you are a javascript enthusiast, that is all fine and sorted out, but what if you prefer to work with ASP.NET and all it's nice server controls, strong-typed programming model? You would really expect this kind of functionality to be available in out-of-the-box, but it isn't. Not in the 1.1 release from 2003 and not in the forthcoming 2.0 release. There is some dragging functionality implemented in the Web Part Framework, but this cannot be used for non-WebPart functionality.
But ASP.NET can always easily be extended, so presumably, someone has already implemented some kind of server control that adds drag-drop to other elements on the page? Well, maybe someone has, but I couldn't find it. I was imagining the following:
- A server control named DragDropManager, that is invisible at runtime
- In VS.NET, the property browser show a DragObjects collection and a DropTargets collection. In DragObjects, you can add references to the other controls on the page or user control. Maybe you can also indicate what subelement of the draggable element is the “handle“. You can also specify a CSS classname that will be added to the style of the element during dragging.
- The DropTargets collection can also be filled with references to elements. DropTargets have a hover-class, which is added to the style while something is dragged over the target that could be accepted by the target
- Drag objects and drop targets could also know the concept of content types. Drag objects of content type X can only be dropped on a drop target that accepts X
- When an object is dropped on a target, an event is fired. This can be a client-side event or a server-side event (as configured on the drop target).
Did anyone ever come across this component? Free or paid? It seems very usefull in implementing web applications with rich features. I do know of some frameworks for Rich Internet Applications that include drag-drop, but these typically don't work nicely with standard existing ASP.NET server controls. Still, I don't see a reason why this couldn't work.
PS. The envisioned DragDropManager would of course be even cooler when implemented as an ExtenderProvider, so you could set all of the drag related proerties on the object-to-drag itself. But it seems that ExtenderProviders do not work well for web forms in VS.NET 2003 (more info and a fix).