我有兩個不同的按鈕,即保存和更新。我想打開兩個按鈕的單個彈出式窗口,那我該怎麼做。?如果彈出窗口在保存按鈕上打開,則點擊,然後當它關閉時,它應該指向OnClick_save()按鈕事件,如果它是從更新按鈕打開的,則在彈出的窗口上,它應該指向OnClick_Update()按鈕點擊事件。打開單彈出從兩個不同的按鈕
我該怎麼做? 這是我的代碼
<tr>
<td>
<table id="tblButton" runat="server">
<tr>
<td>
<asp:Button ID="btnAdd" runat="server" Text="Add" Visible="false" />
<asp:Button ID="btnUpdate" runat="server" Text="Update" Visible="false" /> <asp:Button ID="btnDelete" runat="server" Text="Delete" Visible="false" />
<asp:Button ID="btnTargetButton" runat="server" Text="PopUpTarget" Visible="false" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<cc1:ModalPopupExtender ID="ModalPopupExtenderSave" runat="server" TargetControlID="btnTargetButton" PopupControlID="passwordPopUp" DropShadow="true" PopupDragHandleControlID="header" BackgroundCssClass="modalBackground" BehaviorID="ModalPopupExtenderSave" />
</table>
<asp:Panel ID="passwordPopUp" runat="server" Style="display: none; padding: 10px;
border: 1px; border-style: solid;" BackColor="#91C83B" Width="300px" HorizontalAlign="Center"
BorderStyle="Solid" BorderWidth="5px">
<table class="TABLE100">
<tr>
<td colspan="3">
<h3 style="text-align: center;" id="header">
Confirm Password</h3>
</td>
</tr>
<tr>
<td colspan="3">
</td>
</tr>
<tr>
<td>
</td>
<td width="50px">
<asp:Label ID="lblPasswrd" runat="server" Text="Password" Font-Bold="True" Font-Size="Larger"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtPassword" runat="server" SkinID="TextBoxLong"></asp:TextBox>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
<asp:Button ID="btnSubmit" runat="server" Text="SUBMIT" Width="70px" OnClick="btnSubmit_Click"/>
</td>
</tr>
</table>
</asp:Panel>
有些我是如何解決這個問題達到一定的程度。 現在的問題是三個不同的按鈕,即。插入,更新和刪除按鈕負責打開彈出窗口,然後打開一個ASP:面板面板包含提交按鈕。所以在提交按鈕上,我可以知道哪個按鈕負責打開面板。
..沒有得到你的觀點...請詳細說明.. –
我已經編輯了我的問題與代碼...請解釋我使用該代碼.. –
作爲你的'btnTargetButton'被隱藏 讓我們說你的** btnSubmit_Click **你做所有的邏輯,當你需要調用MPE(Modal Popup Extender)時,你只需調用'btnTargetButton_Click'並在該按鈕的** Click **處理程序中調用MPE,如'MPE.show()'然後在完成所有您想要的工作後,您可以編寫'MPE.hide()'並關閉Modal Popup。 –