PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

Cause UpdatePanel to refresh on popup window close

 
 
Andy
Guest
Posts: n/a
 
      18th Apr 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
 
      21st Apr 2010


"Andy" <(E-Mail Removed)> wrote in message
news:a6263987-52b0-49f8-9570-(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
Rate This Thread
Rate This Thread:

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 Form from Popup with window.opener Dave Microsoft C# .NET 4 29th Dec 2007 01:58 PM
Refresh Form from Popup with window.opener Dave Microsoft C# .NET 0 25th Dec 2007 09:10 PM
How to refresh calling window from a popup window =?Utf-8?B?T3Bh?= Microsoft ASP .NET 3 14th Jun 2006 06:25 PM
popup window close to submit opener window without 'causes validation' happening Matt Jensen Microsoft ASP .NET 1 16th Dec 2005 03:16 PM
Popup Main Window Refresh =?Utf-8?B?QW5kcmV3IEFsZ2Vy?= Microsoft Dot NET 4 11th Nov 2004 08:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:18 PM.