Reputation:
I have modalpopupextender in user control. And I load user control dynamic and multiple instance of that user control meaning I have multiple instances of modalpopupextender loaded dynamically. How do I set behaviorid so I can call .add_shown method to call some javascript on modal popup load ?
Upvotes: 0
Views: 994
Reputation: 11
This should do the trick:
function pageLoad() {
//Find all the Popups that deal with ZoomTo and add a add_shown handler.
var AllThem = Sys.Application.getComponents();
for (them in AllThem) {
if (AllThem[them]._PopupControlID != undefined) {
var d = AllThem[them]._PopupControlID;
if (d.indexOf("ZoomToPanel") >= 0) {
//Add the
AllThem[them].add_shown(onZoomToPanelShown);
}
}
}
}
function onZoomToPanelShown() {
//Clear the AutoComplete box.
var t2 = $$get('txtAutoComplete');
t2.value = "";
}
Upvotes: 1