Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pop up windows in ASP

Status
Not open for further replies.

angel07

Programmer
Apr 25, 2001
3
US
I'm currently working on an application that I want to amend so that it has a new postcode look up function.

The applcation has an address page with existing address info and a postcode lookup button. Upon clicking the button I want a new window to open taking across the existing address info to be displayed at the top of the new window.

I then have the address lookup functionality which I've got already.

After the postcode search has been completed the results are to be displayed as hyperlinks. Upon selecting the result I want (ie clicking on the specific hyper link) I want the pop up window to close with the new address details to populate the address page in place of the old ones.

Can anyone tell me if this is possible or not and if so how I can go about it. I've hit a brick when it comes to opening a new window and thats just the beginning of it.

 
Here's a thread where I showed a guy how to open up a new window:

thread333-76232

and in that thread, it has code on how to send a variable back to the opener --

in this case, your syntax would be:
window.opener.location='theURL.com';
window.close();

which would move the opener to the new location (presumably the one they click on), and then close the pop-up window --

If you want to send the new window a value, you would probably do so via querystring such as:

var url;
url = 'theNewWindowAddress.asp?variable='+value
var x = window.open(url... etc...) more syntax is in the thread

and then pick up the value you sent on the new page like:
request.querystring("variable")

That should get you moving again.

Post back if you need more assistance.

:)
Paul Prewett
 
Thanks for your help so far, it's all becoming a little clearer now.

Just to clarify as I'm still unsure re the window.opener.location='theURL.com' so I'll try and give more of a clue of what I'm after (which might be a bit tricky as I'm very new to all this and not to sure what I'm after)
I've got a button on my NameAddress.asp and also a value for the current address. When I click the button I want a new page called Postcode.asp to pop up with the current address value taken over & also the postcode value (I think I'm ok with taking the values over now)
I'll then do the postcode search in Postcode.asp to provide me with the list of results in hyper links. Then clicking the hyperlink will close the popup window (postcode.asp) and populate the NameAddress.asp.

Also forgot to mention that the script language we're using is VB Script. I got a little tied up & confused & then noticed it was javascript in your posting.
 
Ahh --

Well, I'm not that great in client side vbscripting opening windows, passing values and such -- so I don't know how much help I could be in that department.

I don't use it due to the fact that it only works in IE -- Don't get me wrong... I hate Netscape just as much as the next developer, but I at least try to make my stuff work there, as well.

good luck. :)
 
Link9, if I'm lucky you'll get an alert that I'm replying to this ooooold post.
I read your FAQ on communication between browser windows. In my ASP.NET app, I have a pop-up calendar that passes back the date value, and then closes, but it doesn't work in Netscape 7(the only Netscape version I checked)
The calendar has a server side myCalendar_ItemChanged event that creates the javascript with the user selected date in it, and writes it to the <HEAD> of the calendar pop-up like this:
<script language=&quot;javascript&quot;>window.opener.frmSearch.StartDate.value = '10/9/2003';window.close();</script>

I can see this script written in the post back of the Calendar pop-up, but the window doesn't close or pass back the value. Do you know why this doesn't work in Netscape?
 
You may want to try this one on the ASP.Net forum, it could be that someone has already run into it and found an answer for you :)

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top