You can obtain key state during DragDrop event.
This topic will show you how to obtain key state during DragDrop event.
To obtain key state during DragDrop event
- Click on WebDragDropExtender instance and press F4.
- On ClientSide >> OnDragDrop property, click the arrow icon and write DragDrop.
- On HTML mode create a new client side function and named it function DragDrop(controlId, e, dropObject). Here are the complete code :
JavaScript
Copy Codefunction DragDrop(controlId, e, dropObject) { var listBox = document.getElementById("listBox1"); var op = document.createElement("option"); var effectText = ""; if (e.Effect == ISDragDropEffects.Copy) effectText = "Copied"; else if (e.Effect == ISDragDropEffects.Move) effectText = "Moved"; else if (e.Effect == ISDragDropEffects.Link) effectText = "Linked"; else effectText = "[Default] Moved"; op.text = effectText + " '" + e.Data + "' to '" + dropObject.Element.id + "'"; listBox.options.add(op); }
- Compile and run the project.