Pop-Up Window - Return data

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
 
D

DalePres

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
 
S

Steve C. Orr [MVP, MCSD]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top