My app has a number of ways that a (full) postback can occur while navigating the pages of something like a wizard. I want a 'Please wait...' ModalPopup to happen no matter how the postback is triggered. So I've got an asp:Panel, a ModalPopupExtender, and some very simple script in my master page. I'm using RegisterOnSubmitStatement to hook all postbacks, and the script function that's called there just calls "show()" on the ModalPopupExtender. The modal popup appears and the background is grayed out. When the new page is rendered, everything from the previous page is gone; so the page looks refreshed and the modal popup has "disappeared". This is working remarkably well and took very little time to implement.
The one problem I'm having is that there are a few pages on the site where an UpdatePanel is used to allow a partial rendering based on the change in a checkbox or a dropdownlist. Because I'm hooking *every* postback, the modal popup appears in this case. And because it's not a full rendering, the modal popup stays shown after the partial rendering completes, which of course renders the page useless.
I see two ways of correcting this, both of which are probably fairly simple. I'm just new enough to the asp.net ajax stuff that I haven't stumbled across the right magic yet. ;)
a) In my OnSubmit function (where I call show() on the modalpopupextender), if I can detect that the postback is going to be a partial postback, then I can just skip showing the modal popup altogether.
b) Alternatively, if I can "hook" the completion of the partial postback, I can call "hide()" on the modalpopupextender to make it disappear.
I think b) would be advantageous in the event that the partial postback is a little slow. But it really should never be, so I slightly prefer a).
Any pointers on how to accomplish either or both of these?
Thanks much,
Donnie