views:

1320

answers:

2

I have a javascript that disables a button for x seconds and then enables the button after x seconds pass. An update button checks for certain constraints, and if met, a modal popup is shown. The button the javascript is meant for is located in a panel displayed by this modal popup. Is there a way I can execute the javascript when the modal popup / panel is shown?

+1  A: 

You can use the following approach if you want to run JavaScript code when a modal popup is showing:

$find("myModalPopupExtender").add_showing(function() {
    alert("Modal popup will be shown.");
});

The alert will be shown each time the modal popup extender shows the popup.

Ronald Wildenberg
This solution makes perfect sense, but for some reason it is not showing the alert. "myModalPopupExtender" - is this the control's ID or the BehaviorID?
swolff1978
After adding a BehaviorID to the popupextender and moving this script to the pageLoad() function in the .aspx page I was able to get this to work. Thank you for the help!
swolff1978