So I have two options here. on an asp button with id="Btn1" I have OnClientClick="popConfirm()" or I could do this from code behind Btn1.OnClientClick = String.Format("popConfirm()") and so forth. I want to be able to master both here but ultimately choose either one in different scenarios.
Problem 1: The problem I'm facing that I can't stop the code behind version to stop and wait for a confirm button clicked in the modalpopup. It will just continue to run code. Is there something I'm doing wrong here. How can I get it to stop and wait and listen that confirm has been clicked?
Problem 2: If I use javascript function popConfirm(), its not finding the ajaxmodalpopup control and I've even (I think) properly resorted to using the BehaviorID. It just returns null object found. Here below is this version.
<script type="text/javascript">
function popConfirm() {
var theModal = $find('confirmPopUp');
theModal.show();
return false;
}</script><asp:Button runat="server" ID="inviteall" CssClass="btn btn-default" OnClientClick="popConfirm()" meta:resourcekey="InviteAll" CommandName="InviteSelected" Visible='<%# SurveyControlPanel1.IsPublished && SurveyControlPanel1.AllowInvites %> ' /><!--.modal-content --><asp:ImageButton ID="imgHiddenConfirm" runat="server" CausesValidation="false" Style="display: none" /><ajaxToolkit:ModalPopupExtender ID="confirmModalPopup" runat="server" BackgroundCssClass="modalBackground" BehaviorID="confirmPopUp" CancelControlID="PopupCloseButton" PopupControlID="pnlConfirm" TargetControlID="imgHiddenConfirm"></ajaxToolkit:ModalPopupExtender><asp:Panel ID="pnlConfirm" runat="server" CssClass="modalPopup" Style="display: none"><div id="mod-info4"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"></div><div class="modal-body"><div class="text-center"><div class="i-circle info"><i class="fa fa-info"></i></div><h3>Invite(s)</h3>
Are you sure you want to send invites to selected users?</div></div><div class="modal-footer"><asp:Button ID="btnClose" runat="server" CssClass="btn btn-default" Text="Ok" /><asp:Button ID="btnConfirm" runat="server" Text="Confirm" /></div></div></div></div></asp:Panel><!-- /.modal-content -->So what's going on here in both scenarios? thanks for any help