-->

Tuesday, May 7, 2013

How to use DragPanelExtender in ajax

How to use DragPanelExtender in ajax

DragpanelExtender enables you to drag a panel within the webpage .DragPanelExtender adds a drag effect to the panels of your web page . This makes the panels virtually float on the web page . Using this extender , you can easily drag  the panels by clicking their associated drag handles.


lets take an Example

Copy this code and paste your web form ( Before copy you must add ajax control tool kit to your project )


<%@ Page Language="C#" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<script runat="server">


</script>


<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
    <title></title>
    <style >
    .dragpanel
    {
        cursor :move ;
        text-align :center ;
        font-size :large ;
        background-color :Green ;
    }
    
    
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
    
        <asp:Panel ID="Panel1" runat="server">
            <asp:Panel ID="Panel2" runat="server">
            <div class ="dragpanel">
            drag me
            </div>
            </asp:Panel>
            <asp:Panel ID="Panel3" runat="server">
            DragpanelExtender enables you to drag a panel within the webpage .DragPanelExtender adds a drag effect to the panels of your web page . This makes the panels virtually float on the web page . Using this extender ,
             you can easily drag  the panels by clicking their associated drag handles
            </asp:Panel>
        </asp:Panel>
        <asp:DragPanelExtender ID="DragPanelExtender1" runat="server" TargetControlID ="Panel1" DragHandleID ="Panel2">
        </asp:DragPanelExtender>
    
    </div>
    </form>
</body>
</html>

OutPut

How to use DragPanelExtender in ajax


Properties of DragPanelExtender :

TargetControlID: Sets the ID of the panel to which you want to drag.

DragHandleID: Sets the ID of the control to which you want to make treat as a drag handle for the panel.


Read other related articles

Also read other articles

© Copyright 2013 Computer Programming | All Right Reserved