The DragPanel extender allowsusers to easily add "draggability" to their controls. The DragPanel targets any ASP.NET Panel and takes an additional parameter that signifies the control to use as the "drag handle". Once initialized, the user can freely drag thepanel around the web page using the drag handle. DragPanel Properties:
panel around the web page using the drag handle.
DragPanel Properties:
•TargetControlID - The ID of a Panel to make draggable.
•DragHandleID - The ID of a control that will serve as the "drag handle" for the panel. When the user clicks and drags this control, the panel will move.
Code:
//we adds the script manager and drag panel extender which control the panel1 (we move this panel as given in fig)
<asp:ScriptManagerID="ScriptManager1"runat="server"></asp:ScriptManager>
<cc1:DragPanelExtenderID="DragPanelExtender1"runat="server"TargetControlID="Panel1" DragHandleID="Label2">
</cc1:DragPanelExtender>
<asp:PanelID="Panel2"runat="server"Width="700px"Height="600px">
<asp:PanelID="Panel1"runat="server"BackColor="#6666FF"Width="500px"Height="210px">
<br/>
<asp:LabelID="Label2"runat="server"Text="Drag" CssClass="dragIcon'"> </asp:Label>
<asp:ImageID="Image1"runat="server"ImageUrl="~/Untitled.png"/>
</asp:Panel>
</asp:Panel>
Here DragHandleIDis "Label2" when drag Label2 and move then (TargetControlID="Panel1")Panel1 will also move
Anonymous User
25-Feb-2019Thank You for sharing it.
Sunil Singh
10-Jul-2017Your words increase my knowledge for sure. Thanks