articles

Home / DeveloperSection / Articles / Ajax Toolkit DragPanelExtender Control in ASP.Net

Ajax Toolkit DragPanelExtender Control in ASP.Net

Anonymous User21783 07-Dec-2010

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

Run the project

Ajax Toolkit DragPanelExtender Control in ASP.Net

When drag and move drag text then panel will also move

Ajax Toolkit DragPanelExtender Control in ASP.Net

When page will refresh then moved panel will be its original position

Ajax Toolkit DragPanelExtender Control in ASP.Net



Updated 04-Mar-2020
I am a content writter !

Leave Comment

Comments

Liked By