title: AjaxControlToolKit ModalPopupExtender Drag snap back to center
body: <p>I am using ModalPopupExtender of AjaxControlToolKit 4.0 (ASP.NET 4.0), every thing working fine, when I drag ModalPopup it is dragging, but the problem is that it is snaping back to its original location(Center).
  The same code is working on:
  <a href="http://www.asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx" rel="nofollow">http://www.asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx</a></p>
  
  <p>I have search about this issue but all solutions are given by using external Java script code, but what can be the mistake on following code while the same code working on ASP.NET example page. (From where I copied the same code)</p>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="AjaxToolKitTest4.WebForm3" %&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  
  &lt;head runat="server"&gt;
      &lt;title&gt;Hello&lt;/title&gt;
      &lt;link href="style.css" rel="stylesheet" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
          &lt;ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"&gt;&lt;/ajaxToolkit:ToolkitScriptManager&gt;
  
          &lt;div&gt;
              &lt;%--Start LinkButton to Show Modal Popup Form--%&gt;
              &lt;asp:LinkButton ID="lnkAddForm" Text="Insert" runat="server" OnClick="lnkAddForm_Click"&gt;&lt;/asp:LinkButton&gt;
              &lt;%--End LinkButton to Show Modal Popup Form--%&gt;
  
              &lt;%--Start Panel for Modal Popup Form--%&gt;
              &lt;asp:Panel ID="programmaticPopup"  runat="server" CssClass="modalPopup" Style="display: none; width: 350px; padding: 10px;"&gt;                
                  &lt;asp:Panel runat="Server" ID="programmaticPopupDragHandle" Style="cursor: move; width:100%; background-color: #DDDDDD; border: solid 1px Gray; color: Black; text-align: center;"&gt;
                      Title Bar
                  &lt;/asp:Panel&gt;
                      Content of Modal Form
              &lt;/asp:Panel&gt;
              &lt;%--End Panel for Modal Popup Form--%&gt;
  
              &lt;%-- Start AjaxToolKit ModalPopupExtender for Panel  --%&gt;
              &lt;asp:Button runat="server" ID="hiddenTargetControlForModalPopup" Style="display: none" /&gt;
              &lt;ajaxToolkit:ModalPopupExtender 
                  ID="programmaticModalPopup"                 
                  BehaviorID="programmaticModalPopupBehavior"
                  TargetControlID="hiddenTargetControlForModalPopup" 
                  PopupControlID="programmaticPopup"
                  BackgroundCssClass="modalBackground" 
                  DropShadow="false" 
                  PopupDragHandleControlID="programmaticPopupDragHandle"
                  RepositionMode="RepositionOnWindowScroll"
                  runat="server"&gt;
              &lt;/ajaxToolkit:ModalPopupExtender&gt;
              &lt;%-- End AjaxToolKit ModalPopupExtender for Panel  --%&gt;
          &lt;/div&gt;
  
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>