Does Ajax ModalPopupExtender has an option to create 3 buttons? Yes, No and Cancel? for ASP.NET WebForms, C#
I could not come up with a solution. I can just find OKControlID and CancelControlID.
<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>
Here, I do want to call different functions for Yes and No.
Instead of OKontrolID, you can use extender's client side API to hide it on button's on-click event. See this article that shows multiple cancel button - your scenario is similar, you just need to return true from your button's onclick event handler.
<ajaxToolkit:ModalPopupExtender runat="server" BehaviorID="myPopup" ...
and
<input id="btnYesMerchant" type="button" onclick="$find('myPopup').hide(); return true;" ...
Thought i found it to be so tough, it is simple to handle this problem. We just got to add return true for each asp button.
ANd remove the OKCOntrolID from ModalPopupExtender. It solved my problem. Thanks all who gave it a try reading.
精彩评论