对于Save按钮,我有一个弹出窗口,里面有3个按钮。,Yes,No和Cancel。是应调用函数并更新数据库中的2个表,否则应仅更新一个表,取消不应在页面中进行任何更改。
用于弹出的代码
<table id="pnlPopupMerchantUpdate" runat="server" style="display:none">
<tr>
<td>
<asp:Panel runat="server" CssClass="modalPopup">
<table width="350" height="80" class="warningPopup">
<tr>
<td>
<!-- <img src="images/warning_blue.gif" alt="Warning" /> -->
</td>
<td colspan="2" align="left" style="padding-left: 75px; padding-top: 10px;">
Do you wish to update the Location Information as well.
</td>
</tr>
<tr>
<td align="center" colspan="4">
<input id="btnYesMerchant" type="button" value="Yes" class="popupButton" causesvalidation="true" onclick="btnYessave_Click"/>
<input id="btnNoMerchant" type="button" value="No" class="popupButton" causesvalidation="true" onclick="btnNosave_Click" />
<input id="btnCancel" type="button" value="Cancel" class="popupButton"/>
</tr>
</table>
</asp:Panel>
</td>
</tr>
如果用户单击是,则必须更新位置信息以及公司信息。如果单击否,则只显示公司信息。取消不会修改任何内容。有一个函数UpdateMerchantInfo(),它必须根据调用的内容进行修改,我的意思是是或否。
我已经使用了Onclick事件的Yes和NO,但问题是,Yes应该在进入UpdatemerchantInfo()之前调用它的onclick事件,与NO相同。
在UpdateMerchantInfo()中,我想使用if循环并做相应的操作。
我希望我很清楚!!
非常感谢!
答案 0 :(得分:0)
您可以在ajax中使用弹出控件扩展器。将找到更多详细信息Here
它有足够的标签来支持您的要求
你必须只创建一个控制(使用标签)和popup controlid设置id的弹出窗口。使用此方法,您可以定义不同的事件处理程序。