By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 1,876 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

generate popup for search, then populate parent window with selection

P: n/a
Any suggestions on how to go about generating a popup, giving the user a way
of searching for something, and then taking their selection after closing
the pop-up and populating the parent form with the selection from the child?
I can do everything up until the point of having to populate the parent form
with the selection from the child form. How do I put the information back
into the parent so that the asp.net code in the parent can actually retrieve
what the user selected in the child?

JavaScript is the answer, but a snippet of code and/or a link to an example
would be great! Thanks in advance.

Mark
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Mark,

The easiest way to do this is to send the information back to the original
window in the query string. You may use a javascript window.open command to
"re-open" the original window. The trick to making the javascript re-use the
original window is to name the original window and then target that window
name with the window.open command.

So:

Place a javascript in your original page like this:

<script language="JavaScript">
<!-- Begin
name='first';
// End -->
</script>

Then in your popup when you call the orignal page:

<script language="JavaScript">
<!-- Begin
window.open('FirstPage.aspx?info=[your querystring info
here...]&moreinfo=[more querystring info here...]', 'first')

window.close()

// End -->
<script language="JavaScript">
Since the javascript in the popup opens a window named: "first" it
automatically re-uses the already opened "first" window, then closes itself.

Hope this helps!

If you have any questions let me know.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Any suggestions on how to go about generating a popup, giving the user a way of searching for something, and then taking their selection after closing
the pop-up and populating the parent form with the selection from the child? I can do everything up until the point of having to populate the parent form with the selection from the child form. How do I put the information back
into the parent so that the asp.net code in the parent can actually retrieve what the user selected in the child?

JavaScript is the answer, but a snippet of code and/or a link to an example would be great! Thanks in advance.

Mark

Nov 18 '05 #2

P: n/a
Query string - great idea. Thanks Justin!

Mark

"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message
news:OR**************@TK2MSFTNGP12.phx.gbl...
Mark,

The easiest way to do this is to send the information back to the original
window in the query string. You may use a javascript window.open command to "re-open" the original window. The trick to making the javascript re-use the original window is to name the original window and then target that window
name with the window.open command.

So:

Place a javascript in your original page like this:

<script language="JavaScript">
<!-- Begin
name='first';
// End -->
</script>

Then in your popup when you call the orignal page:

<script language="JavaScript">
<!-- Begin
window.open('FirstPage.aspx?info=[your querystring info
here...]&moreinfo=[more querystring info here...]', 'first')

window.close()

// End -->
<script language="JavaScript">
Since the javascript in the popup opens a window named: "first" it
automatically re-uses the already opened "first" window, then closes itself.
Hope this helps!

If you have any questions let me know.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Any suggestions on how to go about generating a popup, giving the user a

way
of searching for something, and then taking their selection after closing the pop-up and populating the parent form with the selection from the

child?
I can do everything up until the point of having to populate the parent

form
with the selection from the child form. How do I put the information back into the parent so that the asp.net code in the parent can actually

retrieve
what the user selected in the child?

JavaScript is the answer, but a snippet of code and/or a link to an

example
would be great! Thanks in advance.

Mark


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.