Many web applications are required to be complex yet intuitive to the user. One way to achieve this is to create objects or areas of the web page draggable and droppable. Unfortunately, ASP.NET server controls do not have the Drag events and DragEventArgs. Fortunately, there is a way to enable drag and drop functionalities within a web page. Now keep in mind, this is not like a Windows application where you can drag files from the user's PC to the application. The drag and drop is limited to the boundaries of the web page.
Using the code
1. Create a web application within your solution.
2. Create a web page.
3. Add the provided JavaScript in the
of your .
4. Add two textboxes and a button in the web form.
5. Add the DrawContainers method to the code-behind of the web page.
6. Ensure that the click event for the button calls the DrawContainers method.
Go to the complete details ...