Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Cause UpdatePanel to refresh on popup window close

Reply
Thread Tools

Cause UpdatePanel to refresh on popup window close

 
 
Andy
Guest
Posts: n/a
 
      04-18-2010
Hi,

Ok, I have a page with an updatepanel, which can open a popup. The
popup can change an object's values which is stored in the session,
this object is displayed on the main window. I'd like to have the
updatepanel update when the popup is closed.

I can't do the update call after window.open, because that returns
immediately (before the user could possibly edit the settings in the
popup). I tired having a javascript page level variable to store the
popup and set its onunloaded to a function defined in the main
window. That never seems to get called.

Any ideas? The popup is used on a few different pages, so I can't do
anything that would tie it to a particular parent page.

Here's what I have in the parent page:

function openPopup( popupOpener ) {
if ( popupWindow == null ) {
popupWindow = popupOpener();
popupWindow.onunload = setDirty;
}
else {
alert( 'Please close the existing popup editor and try again');
}
}

popupOpener is a function which simply does { return
window.open( ... ); }

setDirty should initiate the updatepanel refresh, but its not being
called.

Thanks
Andy
 
Reply With Quote
 
 
 
 
Gregory A. Beamer
Guest
Posts: n/a
 
      04-21-2010


"Andy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> Ok, I have a page with an updatepanel, which can open a popup. The
> popup can change an object's values which is stored in the session,
> this object is displayed on the main window. I'd like to have the
> updatepanel update when the popup is closed.
>
> I can't do the update call after window.open, because that returns
> immediately (before the user could possibly edit the settings in the
> popup). I tired having a javascript page level variable to store the
> popup and set its onunloaded to a function defined in the main
> window. That never seems to get called.
>
> Any ideas? The popup is used on a few different pages, so I can't do
> anything that would tie it to a particular parent page.


In a popup to another window, you can talk back to the parent window in
JavaScript and send it some info that fires off the AJAX. Another option is
to have the modal popup in a DIV on the same page. Wiring this way makes it
quite easy to wire an action on the DIV to an AJAX call, as you have the
control in the same window. In fact, you can wire the control to AJAX on the
server side and then only show the DIV when necessary. Much easier, but it
may not fit your requirements.

--
Peace and Grace,
Greg

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

************************************************
| Think outside the box! |
************************************************

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
refresh an updatePanel in an other updatePanel fran_j_diaz@yahoo.fr ASP .Net 3 08-08-2007 06:30 AM
popup window close to submit opener window without 'causes validation' happening Matt Jensen ASP .Net 1 12-16-2005 03:16 PM
close current window using window.close() Shang Wenbin Javascript 10 09-02-2005 12:16 AM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM
Close pop window and refresh the parent window J P Singh ASP General 3 02-11-2004 01:59 AM



Advertisments