•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 429,966 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,607 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 6460 | Replies: 1 | Solved
![]() |
•
•
Join Date: Apr 2007
Location: Glasgow::Scotland
Posts: 10
Reputation:
Rep Power: 2
Solved Threads: 2
Hello, first post so be kind 
I'm using the ModalPopup to display a loading message when the user clicks on an imagebutton. The problem here is that while the ModalPopup is on screen, the button event doesn't fire so the page doesn't do anything - it just sits there with a loading message - here is my code...
I need it to fire the ibtnCalculate.Click and show the modal popup
Thanks,
Greg.

I'm using the ModalPopup to display a loading message when the user clicks on an imagebutton. The problem here is that while the ModalPopup is on screen, the button event doesn't fire so the page doesn't do anything - it just sits there with a loading message - here is my code...
<div id="pnlLoading" style="display: none;" class="modalPopup">
<p><img src="/images/mde_loading.gif" /> Contacting Cinema...</p>
</div>
<asp:ImageButton ID="ibtnCalculate" runat="server" ImageUrl="~/images/ordertickets.gif" />
<ajaxToolkit:ModalPopupExtender ID="mde1" runat="server"
TargetControlID="ibtnCalculate"
PopupControlID="pnlLoading"
BackgroundCssClass="modalBackground"
DropShadow="true" />I need it to fire the ibtnCalculate.Click and show the modal popup

Thanks,
Greg.
This station is non-operational.
•
•
Join Date: Apr 2007
Location: Glasgow::Scotland
Posts: 10
Reputation:
Rep Power: 2
Solved Threads: 2
OK, I finally managed to get this cracked!
Basically you need an invisible button that you apply the ModalPopupExtender to, you then call the Click of this invisible button using javascript like this...
HTML:
Backend code:
That shows the Modal Popup and posts back to the server
Cheers,
Blackred.
Basically you need an invisible button that you apply the ModalPopupExtender to, you then call the Click of this invisible button using javascript like this...
HTML:
<script type="text/javascript">
function btnClick(id) {
document.getElementById('ctl00_cpContent_btn' + id).click() // if you know of a better way to get this, let me know!
}
</script>
<!-- Visible button -->
<asp:ImageButton ID="ibtnCancel" runat="server" ImageUrl="~/images/cancel.gif" />
<!-- Invisible button -->
<span style="display: none">
<asp:Button ID="btnCancel" runat="server" />
</span>
<!-- Modal Popup Content -->
<div id="pnlLoading1" style="display: none;" class="modalPopup">
<p><img src="~/images/mde_loading.gif" runat="server" /> Contacting Cinema...</p>
</div>
<ajaxToolkit:ModalPopupExtender ID="mde1" runat="server"
TargetControlID="btnCancel"
PopupControlID="pnlLoading1"
BackgroundCssClass="modalBackground" />Backend code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ibtnCancel.Attributes.Add("onclick", "btnClick('Cancel')")
End SubThat shows the Modal Popup and posts back to the server

Cheers,
Blackred.
This station is non-operational.
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net .net framework 3.0 access ajax asp business code combo custom cyber-squatting data developer development dom domains dropdownlist feed microsoft module msdn net office pay-per-click reader reuse security skin small business smb software sql strider theme trademark typo-squatting vista voips weather web windows workflow xml xoap
- Button click event only working the second time (C#)
- Passing value of string from one button click event to another (ASP.NET)
- Click event >> window appears? (Python)
- ImageButton Command Event (ASP.NET)
- Control button Click event (Visual Basic 4 / 5 / 6)
Other Threads in the ASP.NET Forum
- Previous Thread: save textbox values to database
- Next Thread: AutoComplete TextBox


Linear Mode