Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

ModalPopupExtender disappears after postback

$
0
0

I have a page with a ModalPopupExtender which is used to show a modal progress animation during postbacks.  This control, as well as the asp:Panel which displays the progress animation, are the last two items in the .aspx file.  Actually they are the last items within an asp:Content tag since the page uses a master page.

The use of this control appears to follow some examples I've seen.  That is the code uses $find('MyBehaviorID'), where MyBehaviorID is the value of the BehaviorID property of the control on the page, to get a reference to the ModalPopupExtender instance in order to call .show() or .hide() as is required.  The acquisition of the reference to the ModalPopupExtender instance and the call to the .show() or .hide() method is performed in event handler methods associated to the PageRequestManager beginRequest and pageLoaded events respectively.

This all works fine except for one particular scenario.  The page has two update panels.  One of the panels contains a PostBackTrigger for a button inside that panel.  When a user clicks this button, the entire page posts back, and when the page loads again all subsequent calls to $find('MyBehaviorID') return null.  Upon examination of the html in the browser, before and after this postback, you can see that the html code which appears to be the result of the ModalPopupExtender disappears after the postback.

Is there any obvious reason why this would be happening?  I don't understand why this object ceases to be available after this particular button generated postback.


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>