ModalPopUpExtender 引用了“hiddenTargetControlForModalPopup”——这是 UI 上的一个隐藏按钮,除了下面显示的代码外,它似乎没有在任何地方使用。
模态弹窗的目标是PANEL pnlNew,那为什么TagetControlID分配给ID="hiddenTargetControlForModalPopup"呢?只是想了解这种接线...谢谢!
CancelControlID="btHiddenOK" 不在模态弹出控件上的任何地方使用(在模态弹出控件上有一个单独的取消按钮(请参阅评论下方的更新面板中的保存和取消按钮..LOT OF CODE。 ....所以我试图删除属性 CancelControlID="btHiddenOK" - 这导致模式弹出被禁用?我想知道如果 btHiddenOK 甚至没有在模式弹出上使用 - 删除它不应该有任何效果,但似乎并非如此?
<asp:Button runat="server" ID="hiddenTargetControlForModalPopup" style="display:none"/>
<asp:Panel ID="pnlNew"
runat="server"
DefaultButton="hiddenTargetControlForModalPopup"
style="width: 575px;">
<!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
<div class="shadowAreaBig" >
<asp:UpdatePanel runat="server" ID="ModalPopupControls" UpdateMode="Conditional">
<ContentTemplate>
<div class="shadowContainer shadowContainerNew" >
<!-- LOT OF CODE -->
<div class="buttonsNew">
<span class="buttonSave">
<asp:ImageButton AlternateText="Create new user" ID="ImageButton1" runat="server" ImageUrl="~/css/images/buttonSave2.png" OnClick="btOK_Click" OnClientClick="javascript:return validateControls();" TabIndex="110" style='display: none;' />
<img style="border-width:0px;cursor: default;" alt="Create new user" src="../css/images/buttonSave2_disabled.png" tabindex="110" id="ImageButton1_Disabled" >
</span>
<span class="buttonCancel"/>
<asp:ImageButton AlternateText="Cancel" ID="ImageButton2" runat="server" CausesValidation="False" ImageUrl="~/css/images/buttonCancel.png" OnClientClick="cancel();return false;" TabIndex="111"/>
</span>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
<p class="clearFloat"></p>
</asp:Panel>
</div>
<cc1:ModalPopupExtender
ID="CreateMPExtender"
runat="server"
TargetControlID="hiddenTargetControlForModalPopup"
PopupControlID="pnlNew"
BackgroundCssClass="modalBackground"
DropShadow="false"
BehaviorID="ModalPopupBehavior"
OkControlID="btHiddenOK"
OnOkScript="ok()"
OnCancelScript="hideModalPopup()"
RepositionMode="RepositionOnWindowResizeAndScroll"
PopupDragHandleControlID="pnlNewSRO"
CancelControlID="btHiddenOK"
/>
<asp:Button ID="btHiddenOK" runat="server" Style="visibility:none" />