我有两个不同的按钮,即保存和更新。我想打开两个按钮的单个弹出式窗口,那我该怎么做。?如果弹出窗口在保存按钮上打开,则点击,然后当它关闭时,它应该指向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。 –