---
title: "Ajax Toolkit DragPanelExtender Control in ASP.Net"  
description: "The DragPanel extender allowsusers to easily add \"draggability\" to their controls. The  DragPanel targets any ASP.NET Panel and takes an additional pa"  
author: "Anonymous User"  
published: 2010-12-07  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/262/ajax-toolkit-dragpanelextender-control-in-asp-dot-net  
category: "ajax"  
tags: ["ajax"]  
reading_time: 2 minutes  

---

# Ajax Toolkit DragPanelExtender Control in ASP.Net

The DragPanel extender allows users 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 the panel 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:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>  <cc1:DragPanelExtender ID="DragPanelExtender1" runat="server" TargetControlID="Panel1" DragHandleID="Label2"></cc1:DragPanelExtender>  <asp:Panel ID="Panel2" runat="server" Width="700px" Height="600px"><asp:Panel ID="Panel1" runat="server" BackColor="#6666FF" Width="500px" Height="210px"><br /><asp:Label ID="Label2" runat="server" Text="Drag"  CssClass="dragIcon'"> </asp:Label><asp:Image ID="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

![AjaxControl Toolkit DragPanelExtender Control in ASP.Net](https://www.mindstick.com/mindstickarticle/505e257a-7411-45b6-9ab9-65dfcf84edf6/images/514930ce-0765-4799-9f32-0f04b5cda5e9.png)

##### When drag and move drag text then panel will also move

![AjaxControl Toolkit DragPanelExtender Control in ASP.Net](https://www.mindstick.com/mindstickarticle/505e257a-7411-45b6-9ab9-65dfcf84edf6/images/8aa67200-58b3-4b9d-bde7-8a5d6663fa18.png)

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

![AjaxControl Toolkit DragPanelExtender Control in ASP.Net](https://www.mindstick.com/mindstickarticle/505e257a-7411-45b6-9ab9-65dfcf84edf6/images/3bcc716d-5a09-4cb6-ac8a-1060affa8456.png)

\

---

Original Source: https://www.mindstick.com/articles/262/ajax-toolkit-dragpanelextender-control-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
