Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* function in the main(parent) page */
- var _onMyModalPopupHide = null;
- function pageLoad(){
- // would be called by ScriptManager when page loads
- // add the callback that will be called when the modalpopup is closed
- $find('MyModalPopupBehaviorID').add_hidden(onMyModalPopupHide);
- }
- // will be invoked from the iframe to show the popup
- function ShowMyModalPopup(callback) {
- _onMyModalPopupHide = callback;
- $find('MyModalPopupBehaviorID').show();
- }
- /* this function would be called when the modal popup is closed */
- function onMyModalPopupHide(){
- if (typeof(_onMyModalPopupHide) === "function") {
- // fire the callback function
- _onMyModalPopupHide.call(this);
- }
- }
- /* functions in the page loaded in the iframe */
- function ShowPopup(){
- if(typeof(window.parent.ShowMyModalPopup) === "function") {
- window.parent.ShowMyModalPopup.apply(this, [OnPopupClosed]);
- }
- }
- // will be invoked from the parent page .. after the popup is closed
- function OnPopupClosed(){
- // do something after the modal popup is closed
- }
Add Comment
Please, Sign In to add comment