2

我在我的 Web 应用程序中使用 Ajax ControlToolkit 中的 ModalPopupExtender。我将它的 Drag 属性设置为 true,但是当我将弹出面板拖放到新位置时,它立即回到原来的位置。我想得到效果像示例一样,可以拖放到不同的位置。如何在页面上的示例中..

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx

这是我的代码:

<form id="form1" runat="server">

    <asp:scriptmanager id="ScriptManager1" runat="server">
       </asp:scriptmanager> 

       <asp:button id="btnAddNew" runat="server" text="New Expanse" />

       <asp:modalpopupextender id="ModalPopupExtender1" 
                runat="server" cancelcontrolid="btnCancel" 
                okcontrolid="btnOkay" targetcontrolid="btnAddNew" 
                popupcontrolid="Panel1" popupdraghandlecontrolid="PopupHeader" 
                drag="true" backgroundcssclass="ModalPopupBG">
      </asp:modalpopupextender>

<div class="popupConfirmation" id="Panel1" style="display: none">

        <iframe id="frameeditexpanse" src="Benutzer.aspx" frameborder="1" height="500px" width="520px">
        </iframe>

        <div class="popup_Buttons" style="display: none">
            <input id="btnOkay" type="button" value="Speichern" />
            <input id="btnCancel" type="button" value="Abbrechen" />
        </div>

</div>

PS:如果对话框打开,我想在后台的文本框中输入。

更新:

...

<asp:modalpopupextender id="ModalPopupExtender1" 
                runat="server" cancelcontrolid="btnCancel" 
                okcontrolid="btnOkay" targetcontrolid="btnAddNew" 
                popupcontrolid="Panel1" popupdraghandlecontrolid="PopupHeader" 
                drag="true" backgroundcssclass="ModalPopupBG">
      </asp:modalpopupextender>


   <div id="PopupHeader" style="display: none; background-color:Blue">
        Benutzerinformationen
   </div>

   <div class="popupConfirmation" id="Panel1" style="display: none">

    <iframe id="frameeditexpanse" src="ZweiteSeite.aspx" frameborder="1">
    </iframe>

    <div class="popup_Buttons" style="display: none">
        <input id="btnOkay" type="button" value="Speichern" />
        <input id="btnCancel" type="button" value="Abbrechen" />
    </div>

...

4

2 回答 2

8

尝试这个

<style type="text/css">
  .modalPopup
  {
    background-color: #ffffdd;
    border-width: 3px;
    border-style: solid;
    border-color: Gray;
    padding: 3px;
    width: 100%;
  }
</style>

<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:Button ID="btnAddNew" runat="server" Text="New Expanse" />
    <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" CancelControlID="btnCancel"
        OkControlID="btnOkay" TargetControlID="btnAddNew" PopupControlID="Panel1" PopupDragHandleControlID="PopupHeader"
        Drag="true" BackgroundCssClass="ModalPopupBG">
    </cc1:ModalPopupExtender>
    <div class="popupConfirmation" id="Panel1" style="display: none">
        <asp:Panel runat="server" ID="PopupHeader" CssClass="modalPopup">
            **************** Drag me ****************
        </asp:Panel>
        <iframe id="frameeditexpanse" src="http://www.bing.com" frameborder="1" height="500px"
            width="520px"></iframe>
        <div class="popup_Buttons" style="display: none">
            <input id="btnOkay" type="button" value="Speichern" />
            <input id="btnCancel" type="button" value="Abbrechen" />
        </div>
</div>
于 2012-08-14T08:11:15.307 回答
0

@yogi 发布的答案非常有效。如果有问题,请尝试在不同的浏览器中浏览同一页面,因为它在 Edge 和 Chrome 中运行顺畅,但 Internet Explorer 在移动弹出窗口和拖放时存在问题。

于 2020-05-21T20:46:30.713 回答