tags:

views:

39

answers:

2

Hello guys,

Does Ajax ModalPopupExtender has an option to create 3 buttons?? Yes, No and Cancel? for Asp.net, c#

I have been trying since few days. But 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. Can somone help me. Thanks!!

A: 

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;" ...
VinayC
A: 

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.

Ram