Pop-Up Window - Return data

  • Thread starter Thread starter Jeremy
  • Start date Start date
J

Jeremy

What would it take to create a pop-up window that displays some graphics
(each with a bit of text). Ideally it would behave such that when a user
clicks on a graphic, the pop-up window disappears and some data (e.g., some
ID value of the graphich clicked) is then returned to the window from which
the pop-up was opened?

Thanks
 
You can use the window.createPopup() method of the web browser or the
window.showModalDialog() or window.showModelessDialog() methods. I've done
what you're asking about with each of them. Search MSDN for the methods and
you'll be on your way.

Dale
 
You're going to need to do most of this client side.
Your 2 pages simply don't exist at the same points in time on the server, so
they cannot communicate directly with eachother on the server.

You can open a new window and pass it values using client side javascript
such as this:
a=window.open('MyPage.aspx?id=123','_new')
There are all kinds of options for setting window properties such as window
size and toolbar visibility.
Here's more info:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp

From that new window you can reference the original parent window and pass
values back to it with this javascript reference:

Here's an example:
window.opener.document.form1.mytextbox.value = 'whatever';

Here's more info:
http://www.mozilla.org/docs/dom/domref/dom_window_ref77.html
 
Back
Top