我使用的AjaxControlToolKit 4.0 ModalPopupExtender(ASP.NET 4.0),每一件事情做工精细,当我拖到ModalPopup它拖动,但问题是,它是snaping回到原来的位置(中心)。 相同的代码工作: http://www.asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx
我搜索一下这个问题,但所有的解决方案是通过使用外部Java脚本代码给出,但在ASP.NET示例页面上工作相同的代码是什么可以在下面的代码错误。 (从我复制的相同的码)
这是我的代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="AjaxToolKitTest4.WebForm3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Hello</title>
<link href="style.css" rel="stylesheet" />
</head>
<body>
<form id="form1" runat="server">
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
<div>
<%--Start LinkButton to Show Modal Popup Form--%>
<asp:LinkButton ID="lnkAddForm" Text="Insert" runat="server" OnClick="lnkAddForm_Click"></asp:LinkButton>
<%--End LinkButton to Show Modal Popup Form--%>
<%--Start Panel for Modal Popup Form--%>
<asp:Panel ID="programmaticPopup" runat="server" CssClass="modalPopup" Style="display: none; width: 350px; padding: 10px;">
<asp:Panel runat="Server" ID="programmaticPopupDragHandle" Style="cursor: move; width:100%; background-color: #DDDDDD; border: solid 1px Gray; color: Black; text-align: center;">
Title Bar
</asp:Panel>
Content of Modal Form
</asp:Panel>
<%--End Panel for Modal Popup Form--%>
<%-- Start AjaxToolKit ModalPopupExtender for Panel --%>
<asp:Button runat="server" ID="hiddenTargetControlForModalPopup" Style="display: none" />
<ajaxToolkit:ModalPopupExtender
ID="programmaticModalPopup"
BehaviorID="programmaticModalPopupBehavior"
TargetControlID="hiddenTargetControlForModalPopup"
PopupControlID="programmaticPopup"
BackgroundCssClass="modalBackground"
DropShadow="false"
PopupDragHandleControlID="programmaticPopupDragHandle"
RepositionMode="RepositionOnWindowScroll"
runat="server">
</ajaxToolkit:ModalPopupExtender>
<%-- End AjaxToolKit ModalPopupExtender for Panel --%>
</div>
</form>
</body>
</html>