Greetings everyone!
Let's get started!
So, I have a couple of buttons on my page and I want to use one modal popup for both save clicks. Here is the code for the buttons:
<asp:Button ID="btnSave1" runat="server" OnClick="btnSave1_Click" Text="Save" OnClientClick="$find('showSaveConfirm').show(); return false;" />
<asp:Button ID="btnSave2" runat="server" OnClick="btnSave2_Click" Text="Save" OnClientClick="$find('showSaveConfirm').show(); return false;"/>
<asp:Button ID="btnSaveAll" runat="server" Text="" Style="display: none" />
And here is the information for the Modal panel:
<asp:Panel ID="pnlSaveConfirm" runat="server" Style="display: none;" CssClass="modalPopupContainer">
<div id="Div7" class="modalPopupHeaderPanel">
<div id="Div8" class="modalPopupHeader">
</div>
<asp:LinkButton ID="LinkButton2" runat="server" CssClass="modalPopupClose" CausesValidation="False">Cancel and close</asp:LinkButton>
</div>
<div id="Div9" class="modalPopupBannerPanel">
<div class="modalPopupPanel">
<br />
You are about to save this piece of data.
<asp:Button ID="btnOkSave" runat="server" Text="Ok" />
<asp:Button ID="btnCancelSave" runat="server" Text="Cancel" />
<br />
</asp:Panel>
<ajaxToolkit:ModalPopupExtender ID="mdlPopupSaveConfirm" runat="server" TargetControlID="btnSaveAll" BehaviorID="showSaveConfirm"
OkControlID="btnOkSave" CancelControlID="btnCancelSave" PopupControlID="pnlSaveConfirm" BackgroundCssClass="modalBackground" />
Both clicks trigger the same modal panel perfectly. The cancels work fine, but there seems to be an issue.
When I click on btnOkSave, it doesn't seem to confirm as the btnSave1_Click and btnSave2_Click server side events are not being triggered.
Any thoughts on what might be causing this problem?